Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.SharedPreferences; public class Main { public static void putBoolean(Context context, String key, boolean value) { SharedPreferences sp = context.getSharedPreferences("atguigu", Context.MODE_PRIVATE); sp.edit().putBoolean(key, value).commit(); } }