- // Get a handle for the shared preferences.
- SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getContext());
-
- // Get the theme preference.
- boolean darkTheme = sharedPreferences.getBoolean("dark_theme", false);
-