+ Logger.debug("MainActivity", "onStart()");
+
+ mViewPager.setCurrentItem(mCurrentPage, false);
+ }
+ @Override
+ protected void onSaveInstanceState(@NotNull Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putInt(STATE_CURRENT_PAGE, mViewPager.getCurrentItem());
+ if (Data.accountFilter.getValue() != null)
+ outState.putString(STATE_ACC_FILTER, Data.accountFilter.getValue());
+ }
+ @Override
+ protected void onDestroy() {
+ mSectionsPagerAdapter = null;
+ RecyclerView root = findViewById(R.id.nav_profile_list);
+ if (root != null)
+ root.setAdapter(null);
+ if (drawer != null)
+ drawer.removeDrawerListener(drawerListener);
+ drawerListener = null;
+ if (drawer != null)
+ drawer.removeDrawerListener(barDrawerToggle);
+ barDrawerToggle = null;
+ if (mViewPager != null)
+ mViewPager.removeOnPageChangeListener(pageChangeListener);
+ pageChangeListener = null;
+ super.onDestroy();
+ }
+ @Override
+ protected void setupProfileColors() {
+ SharedPreferences prefs = getPreferences(MODE_PRIVATE);
+ int profileColor = prefs.getInt(PREF_THEME_ID, -2);
+ if (profileColor == -2)
+ profileColor = Data.retrieveCurrentThemeIdFromDb();
+ Colors.setupTheme(this, profileColor);
+ Colors.profileThemeId = profileColor;
+ storeThemeIdInPrefs(profileColor);
+ }
+ @Override
+ protected void onResume() {
+ super.onResume();
+ fabShouldShow();
+ }