diff --git a/app/src/main/java/org/shadowice/flocke/andotp/Activities/AuthenticateActivity.java b/app/src/main/java/org/shadowice/flocke/andotp/Activities/AuthenticateActivity.java index 4de8be91..19afcf01 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/Activities/AuthenticateActivity.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/Activities/AuthenticateActivity.java @@ -212,13 +212,6 @@ public class AuthenticateActivity extends BaseActivity unlockProgress.setVisibility(isTaskRunning ? View.VISIBLE : View.GONE); } - @Override - protected void onDestroy() { - super.onDestroy(); - ProcessLifecycleOwner.get().getLifecycle() - .removeObserver(observer); - } - @Override public void onClick(View view) { Editable text = passwordInput.getText(); @@ -271,6 +264,12 @@ public class AuthenticateActivity extends BaseActivity finish(); } + @Override + public void onBackPressed() { + finishWithResult(false, null); + super.onBackPressed(); + } + @Override protected void onPause() { super.onPause(); @@ -282,9 +281,15 @@ public class AuthenticateActivity extends BaseActivity } @Override - public void onBackPressed() { - finishWithResult(false, null); - super.onBackPressed(); + protected void onDestroy() { + ProcessLifecycleOwner.get().getLifecycle() + .removeObserver(observer); + super.onDestroy(); + } + + @Override + protected boolean shouldDestroyOnScreenOff() { + return false; } /** Retained instance fragment to hold a running {@link AuthenticationTask} between configuration changes.*/