Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.SharedPreferences; public class Main { private static final String EXT_CONFIG = "ext_config"; private static final String KEY_IS_RUNNING = "is_running"; public static void setIsRunning(Context context, boolean isRunning) { SharedPreferences sp = context.getSharedPreferences(EXT_CONFIG, Context.MODE_PRIVATE); sp.edit().putBoolean(KEY_IS_RUNNING, isRunning).commit(); } }