Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { public static final String SHARE_NAME = "config"; public static boolean getBoolean(Context mContext, String key, boolean values) { SharedPreferences sp = mContext.getSharedPreferences(SHARE_NAME, Context.MODE_PRIVATE); return sp.getBoolean(key, values); } }