#635 - Make sure the AuthenticateActivity isn't destroyed on screen off

This commit is contained in:
Joshua Soberg 2021-02-04 20:17:23 -05:00
parent f5c6dfc942
commit 75bc10e1aa

View file

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