Restart visible activity only

This commit is contained in:
M66B 2021-05-12 18:37:36 +02:00
parent 88d1d4cb09
commit 7e77993706
1 changed files with 3 additions and 1 deletions

View File

@ -572,7 +572,9 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
Log.i("Preference " + key + "=" + prefs.getAll().get(key));
if ("theme".equals(key) || "beige".equals(key)) {
finish();
if (this.getClass().equals(ActivitySetup.class) || this.getClass().equals(ActivityView.class))
if (visible &&
(this.getClass().equals(ActivitySetup.class) ||
this.getClass().equals(ActivityView.class)))
startActivity(getIntent());
} else if (!this.getClass().equals(ActivitySetup.class) && !visible &&
Arrays.asList(FragmentOptions.OPTIONS_RESTART).contains(key))