Fixed last activity edge cases

This commit is contained in:
M66B
2022-06-25 08:53:12 +02:00
parent a5d804d91f
commit c473dab127
2 changed files with 18 additions and 3 deletions

View File

@@ -265,6 +265,11 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
visible = true;
if (!(this instanceof ActivityMain)) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().putString("last_activity", this.getClass().getName()).apply();
}
boolean contacts = hasPermission(Manifest.permission.READ_CONTACTS);
if (this.contacts != contacts &&
!this.getClass().equals(ActivitySetup.class) &&
@@ -282,8 +287,6 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
super.onPause();
visible = false;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().putString("last_activity", this.getClass().getName()).apply();
checkAuthentication(false);
}