Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { private static String FILE_NAME = "WasCopy"; public static final String TIME_ACTIVE = "timeActive"; public static void setTimeActive(Context context, boolean fl) { SharedPreferences sd = context.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = sd.edit(); editor.putBoolean(TIME_ACTIVE, fl); editor.commit(); } }