From f2fdeacc07a67ffdce11893d0f337b53d591a7a6 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 13 Jun 2020 21:29:39 +0200 Subject: [PATCH] Workaround Android Q bug --- app/src/main/java/eu/faircode/email/ActivityBase.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index 444bd312a0..8b6b2defbc 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -531,6 +531,16 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc return false; } + @Override + public boolean shouldUpRecreateTask(Intent targetIntent) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q + 1) { + ComponentName cn = targetIntent.getComponent(); + if (cn != null && BuildConfig.APPLICATION_ID.equals(cn.getPackageName())) + return false; + } + return super.shouldUpRecreateTask(targetIntent); + } + public interface IKeyPressedListener { boolean onKeyPressed(KeyEvent event);