Back to project page mac-hopper.
The source code is released under:
MIT License
If you think the Android project mac-hopper listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package uk.co.danhawkes.machopper.ui.preferences; //w ww . j a v a2 s . co m import uk.co.danhawkes.machopper.R; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; public class UiUtils { public static void setThemeFromPreferences(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); boolean light = prefs.getBoolean(context.getString(R.string.pref_key_theme_light), false); context.setTheme(light ? R.style.AppTheme : R.style.AppTheme_Dark); } }