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 setDefaultScreen(Context context, int screens) { SharedPreferences sp = context.getSharedPreferences(ALMOSTNEXUS_PREFERENCES, Context.MODE_PRIVATE); SharedPreferences.Editor editor = sp.edit(); editor.putInt("defaultScreen", screens); editor.commit(); } }