@Override public void onDestroy() { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); prefs.unregisterOnSharedPreferenceChangeListener(this); super.onDestroy(); SettingsManager.save(); }
@Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); LinearLayout root = (LinearLayout) findViewById(android.R.id.list).getParent().getParent().getParent(); Toolbar bar = (Toolbar) LayoutInflater.from(this).inflate(R.layout.settings_toolbar, null, false); bar.setNavigationOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { onBackPressed(); } }); root.addView(bar, 0); }
@Override protected void onResume() { super.onResume(); ThemeManager.applyTheme(this); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); prefs.registerOnSharedPreferenceChangeListener(this); }