aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-11-23 14:22:52 +0100
committerChristian Schneppe <christian@pix-art.de>2018-11-23 14:22:52 +0100
commit6969b92ac1d58617aca868d4f484b50515a516a5 (patch)
tree442e9b096cb295577b1ca99a2c6d5da64c535a50 /src/main/java
parent5af8fae06ff1e9a26e544a22c1ea40b4a5144353 (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.java10
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;
}