#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);
}
@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.*/