From 6198761d42dee7edf61dc0daa575aa92b116f496 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 15 Dec 2018 09:43:42 +0100 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/ActivityView.java | 6 +++++- 1 file changed, 5 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 502412005e..2c76670781 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -337,7 +337,11 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB private Runnable checkIntent = new Runnable() { @Override public void run() { + if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED)) + return; + Intent intent = getIntent(); + String action = intent.getAction(); Log.i(Helper.TAG, "View intent=" + intent + " action=" + action); if (action != null) { @@ -359,7 +363,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB } } - if (getIntent().hasExtra(Intent.EXTRA_PROCESS_TEXT)) { + if (intent.hasExtra(Intent.EXTRA_PROCESS_TEXT)) { String search = getIntent().getCharSequenceExtra(Intent.EXTRA_PROCESS_TEXT).toString(); intent.removeExtra(Intent.EXTRA_PROCESS_TEXT);