Example usage for android.preference PreferenceManager getDefaultSharedPreferences

List of usage examples for android.preference PreferenceManager getDefaultSharedPreferences

Introduction

In this page you can find the example usage for android.preference PreferenceManager getDefaultSharedPreferences.

Prototype

public static SharedPreferences getDefaultSharedPreferences(Context context) 

Source Link

Document

Gets a SharedPreferences instance that points to the default file that is used by the preference framework in the given context.

Usage

From source file:Main.java

public static int getInt(String key, Context context) {
    return PreferenceManager.getDefaultSharedPreferences(context).getInt(key, -1);
}

From source file:Main.java

public static boolean isAutoTransparent(Context context) {
    return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("autoTrans", true);
}

From source file:Main.java

private static String getStr(Context context, String key) {
    return PreferenceManager.getDefaultSharedPreferences(context).getString(key, "");
}

From source file:Main.java

public static void setIconTransparency(Context context, int alpha) {
    PreferenceManager.getDefaultSharedPreferences(context).edit().putInt("icon_alpha", alpha).apply();
}

From source file:Main.java

public static boolean isStatusBarIconHidden(Context context) {
    return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("status_bar_hidden", false);
}

From source file:Main.java

public static int readIntPreference(String s, Context context) {
    return PreferenceManager.getDefaultSharedPreferences(context).getInt(s, 0);
}

From source file:Main.java

public static boolean hasKey(Context context, final String key) {
    return PreferenceManager.getDefaultSharedPreferences(context).contains(key);
}

From source file:Main.java

public static String getPreference(Context context, String key) {
    return PreferenceManager.getDefaultSharedPreferences(context).getString(key, "");
}

From source file:Main.java

public static String readStringPreference(String s, Context context) {
    return PreferenceManager.getDefaultSharedPreferences(context).getString(s, "");
}

From source file:Main.java

public static String GetPref(Context c, String name, String defaultValue) {
    return PreferenceManager.getDefaultSharedPreferences(c).getString(name, defaultValue);
}