Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.SharedPreferences; public class Main { public static final String APP_THEME_LIGHT = "isLight"; public static final String APP_LIGHT_KEY = "light_model"; public static void editLight(Context context, boolean isNight) { SharedPreferences preferences = context.getSharedPreferences(APP_THEME_LIGHT, Context.MODE_PRIVATE); preferences.edit().putBoolean(APP_LIGHT_KEY, isNight).commit(); } }