From a6ed47ac88c2c8c9c544befbfe389d207b550045 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 14 Aug 2018 20:48:58 +0000 Subject: [PATCH] Fixed crash on navigating from new email notification Fixes #39 --- app/src/main/java/eu/faircode/email/ActivityView.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 414b4441..d0da46f0 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -68,6 +68,8 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack private ListView drawerList; private ActionBarDrawerToggle drawerToggle; + private boolean newIntent = false; + static final int REQUEST_VIEW = 1; static final int REQUEST_UNSEEN = 2; @@ -281,7 +283,7 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack if (intent.getBooleanExtra("setup", false)) intent.getExtras().remove("setup"); else - getSupportFragmentManager().popBackStack("unified", 0); + newIntent = true; checkIntent(intent); super.onNewIntent(intent); } @@ -296,6 +298,11 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack iff.addAction(ACTION_VIEW_MESSAGE); iff.addAction(ACTION_EDIT_FOLDER); lbm.registerReceiver(receiver, iff); + + if (newIntent) { + newIntent = false; + getSupportFragmentManager().popBackStack("unified", 0); + } } @Override