List of usage examples for android.content Context MODE_PRIVATE
int MODE_PRIVATE
To view the source code for android.content Context MODE_PRIVATE.
Click Source Link
From source file:Main.java
public static int getInt(Context context, String title) { SharedPreferences sp = context.getSharedPreferences(FILENAME, Context.MODE_PRIVATE); return sp.getInt(title, 0); }
From source file:Main.java
public static boolean getBoolean(Context context, String key) { SharedPreferences sp = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE); return sp.getBoolean(key, false); }
From source file:Main.java
public static int getMaxIndex(Context mContext) { SharedPreferences settings = mContext.getSharedPreferences("clock", Context.MODE_PRIVATE); return settings.getInt(MAX_INDEX, 0); }
From source file:Main.java
public static String getString(String fileName, Context context, String keyId, String defaultValue) { SharedPreferences sharedPreferences = context.getSharedPreferences(fileName, Context.MODE_PRIVATE); return sharedPreferences.getString(keyId, defaultValue); }
From source file:Main.java
static public SharedPreferences getSharedPref(Context context) { return context.getSharedPreferences(ZPREFERENCES, Context.MODE_PRIVATE); }
From source file:Main.java
public static void putString(Context context, String key, String value) { SharedPreferences sp = context.getSharedPreferences("atguigu", Context.MODE_PRIVATE); sp.edit().putString(key, value).commit(); }
From source file:Main.java
public static void appUsageNumber(Context context) { SharedPreferences settings = context.getSharedPreferences("Settings", Context.MODE_PRIVATE); Integer number = settings.getInt("usage_num", 0); settings.edit().putInt("usage_num", number + 1).commit(); }
From source file:Main.java
public static String getFaceUri(String faceId, Context context) { SharedPreferences faceIdUriMap = context.getSharedPreferences("FaceIdUriMap", Context.MODE_PRIVATE); return faceIdUriMap.getString(faceId, ""); }
From source file:Main.java
public static Long getLong(Context context, String title) { SharedPreferences sp = context.getSharedPreferences(FILENAME, Context.MODE_PRIVATE); return sp.getLong(title, 0); }
From source file:Main.java
public static void delString(Context context, String key) { if (sp == null) { sp = context.getSharedPreferences("config", Context.MODE_PRIVATE); }/*from w w w . ja va 2 s . c om*/ sp.edit().remove(key).apply(); }