From 9a4109eaa13d3a6055bc9db306b7c2d58d92474d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 25 Jun 2018 10:31:22 +0200 Subject: [PATCH] catch rare state loss exception when hitting home button to pop back stack --- .../eu/siacs/conversations/ui/ConversationsActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java index 34a02e1b8..70d682564 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java @@ -468,7 +468,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;