List of usage examples for android.preference PreferenceManager getDefaultSharedPreferences
public static SharedPreferences getDefaultSharedPreferences(Context context)
From source file:Main.java
public static boolean getMode(Context context) { SharedPreferences pref2 = PreferenceManager.getDefaultSharedPreferences(context); return pref2.getBoolean("AudioManagerMode", false); }
From source file:Main.java
public static String getLogText(Context context) { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); return sp.getString("log_text", ""); }
From source file:Main.java
private static SharedPreferences getSharedPrefs(final Context context) { return PreferenceManager.getDefaultSharedPreferences(context); }
From source file:Main.java
public static String getIconPack(Context context) { return PreferenceManager.getDefaultSharedPreferences(context).getString(ICON_PACK, ""); }
From source file:Main.java
protected static SharedPreferences getSharedPreferences(Context context) { return PreferenceManager.getDefaultSharedPreferences(context); }
From source file:Main.java
public static boolean getSilentMode(Context context) { SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(context); return SP.getBoolean("silent_pref", false); }
From source file:Main.java
public static String getArea(Context ctx) { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(ctx); String area = preferences.getString("selectedArea", ""); return area;//ww w . ja va2 s.c o m }
From source file:Main.java
public static boolean getVibrateMode(Context context) { SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(context); return SP.getBoolean("vibrate_pref", true); }
From source file:Main.java
public static void remove(Context context, String key) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); prefs.edit().remove(key).apply();/*from w ww . j a v a 2 s . c o m*/ }
From source file:Main.java
public static void clearLoginInfo(Context context) { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = sp.edit(); editor.remove("account"); editor.remove("password"); editor.commit();//from w w w .j a v a 2 s . c o m }