Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; public class Main { public static final String KEY = "org.aisen.android.activityhelp_key"; private static Context mContext; public static void putBooleanShareData(String key, boolean value) { SharedPreferences sp = mContext.getSharedPreferences(KEY, Context.MODE_PRIVATE); Editor et = sp.edit(); et.putBoolean(key, value); et.commit(); } }