List of usage examples for android.preference PreferenceManager getDefaultSharedPreferences
public static SharedPreferences getDefaultSharedPreferences(Context context)
From source file:Main.java
public static String getStringFromDefault(Context context, String key, String defValue) { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); return sp.getString(key, defValue); }
From source file:Main.java
public static String getSharedStringPref(Context context, String key, String dValue) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); return prefs.getString(key, dValue); }
From source file:Main.java
public static void setSharedStringPref(Context context, String key, String value) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = prefs.edit(); editor.putString(key, value);// w w w .j a va 2s .c om editor.apply(); }
From source file:Main.java
public static SharedPreferences getPref(Context context) { return PreferenceManager.getDefaultSharedPreferences(context); }
From source file:Main.java
/** * // ww w . j a v a2 s . c o m * @param context * @param key * @return */ private static boolean getEnable(Context context, String key) { return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(key, false); }
From source file:Main.java
public static void removePreference(Context context, final String key) { final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); if (settings.contains(key)) { settings.edit().remove(key).commit(); }// ww w .j a v a 2 s . c o m }
From source file:Main.java
public static String getParakeetURL(Context context) { String my_receivers = PreferenceManager.getDefaultSharedPreferences(context) .getString("wifi_recievers_addresses", "").trim(); if (my_receivers.equals("")) return null; String[] hosts = my_receivers.split(","); if (hosts.length == 0) return null; for (String host : hosts) { host = host.trim();/*from ww w. j a va 2 s . c o m*/ if ((host.startsWith("http://") || host.startsWith("https://")) && (host.contains("/json.get") || host.contains("Parakeet"))) { return host; } } return null; }
From source file:Main.java
public final static boolean isHideMusicControls(Context context) { return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(prefsKeyHideMusicControls, false); }
From source file:Main.java
public static SharedPreferences GetSettings(Context pCtxt) { return PreferenceManager.getDefaultSharedPreferences(pCtxt); }
From source file:Main.java
public static boolean getSharedBooleanPref(Context context, String key, boolean dValue) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); return prefs.getBoolean(key, dValue); }