From 906271bd4d873f9b2fff2b6688a9253fe3fcaa1b Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Mon, 9 Jul 2018 21:20:40 +0200 Subject: catch rare state loss exception when hitting home button to pop back stack --- src/main/java/de/pixart/messenger/ui/ConversationsActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger') diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java index 5700e659a..91170567d 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java @@ -546,7 +546,11 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio case android.R.id.home: FragmentManager fm = getFragmentManager(); if (fm.getBackStackEntryCount() > 0) { - fm.popBackStack(); + try { + fm.popBackStack(); + } catch (IllegalArgumentException e) { + Log.w(Config.LOGTAG, "Unable to pop back stack after pressing home button"); + } return true; } break; -- cgit v1.2.3