diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-11-23 14:22:52 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-11-23 14:22:52 +0100 |
commit | 6969b92ac1d58617aca868d4f484b50515a516a5 (patch) | |
tree | 442e9b096cb295577b1ca99a2c6d5da64c535a50 /src/main/java | |
parent | 5af8fae06ff1e9a26e544a22c1ea40b4a5144353 (diff) |
catch illegal state exception on fragment transaction
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/StartConversationActivity.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java index c073341f7..825494d90 100644 --- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java @@ -1130,10 +1130,14 @@ public class StartConversationActivity extends XmppActivity implements XmppConne @NonNull @Override public Fragment instantiateItem(@NonNull ViewGroup container, int position) { - Fragment fragment = getItem(position); - FragmentTransaction trans = fragmentManager.beginTransaction(); + final Fragment fragment = getItem(position); + final FragmentTransaction trans = fragmentManager.beginTransaction(); trans.add(container.getId(), fragment, "fragment:" + position); - trans.commit(); + try { + trans.commit(); + } catch (IllegalStateException e) { + //ignore + } return fragment; } |