]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
fix activity restart upon profile theme change
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / MainActivity.java
index 27cc9eba6b68a98e0496130899c8d5cc2a7ae781..dace5c41b19cb854aa5728ff6a5b30a820aba96a 100644 (file)
@@ -478,21 +478,14 @@ public class MainActivity extends ProfileThemedActivity {
         scheduleDataRetrievalIfStale(newValue);
     }
     private void profileThemeChanged() {
-        Bundle bundle = new Bundle();
-        onSaveInstanceState(bundle);
-
         storeThemeIdInPrefs(profile.getThemeHue());
 
-        // restart activity to reflect theme change
-        finish();
-
         // un-hook all observed LiveData
         Data.profile.removeObservers(this);
         Data.profiles.removeObservers(this);
         Data.lastUpdateDate.removeObservers(this);
-        Intent intent = new Intent(this, this.getClass());
-        intent.putExtra(BUNDLE_SAVED_STATE, bundle);
-        startActivity(intent);
+
+        recreate();
     }
     private void storeThemeIdInPrefs(int themeId) {
         // store the new theme id in the preferences