Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { private static final String ALMOSTNEXUS_PREFERENCES = "launcher.preferences.almostnexus"; public static void setDesktopBlocked(Context context, boolean block) { SharedPreferences sp = sp = context.getSharedPreferences(ALMOSTNEXUS_PREFERENCES, Context.MODE_PRIVATE); ; SharedPreferences.Editor editor = sp.edit(); editor.putBoolean("desktopBlocked", block); editor.commit(); } }