Example usage for android.content SharedPreferences getBoolean

List of usage examples for android.content SharedPreferences getBoolean

Introduction

In this page you can find the example usage for android.content SharedPreferences getBoolean.

Prototype

boolean getBoolean(String key, boolean defValue);

Source Link

Document

Retrieve a boolean value from the preferences.

Usage

From source file:Main.java

public static boolean isFirst(SharedPreferences sp) {

    return sp.getBoolean("isFirst", false);
}

From source file:Main.java

public static boolean isOTRDisabled(SharedPreferences preferences) {
    return preferences.getBoolean("settings_key_disable_otr", false);
}

From source file:Main.java

private static String getAction(SharedPreferences prefs, String key) {
    return prefs.getBoolean(key, true) ? "Checked" : "Unchecked";
}

From source file:Main.java

public static boolean getBoolean(Context context, String key, boolean defValue) {
    SharedPreferences sp = getSharedPreferences(context);
    return sp.getBoolean(key, defValue);
}

From source file:Main.java

public static boolean getBooleanFromSP(Context context, String key) {
    SharedPreferences sp = getSharedPreferences(context);
    return sp.getBoolean(key, false);
}

From source file:Main.java

public static boolean getBooleanFromSP(Context context, String key, boolean def) {
    SharedPreferences sp = getSharedPreferences(context);
    return sp.getBoolean(key, def);
}

From source file:Main.java

public static boolean getBoolean(Context context, String tag) {
    SharedPreferences prefs = getSharedPreference(context);
    return prefs.getBoolean(tag, false);
}

From source file:Main.java

public static Boolean getPrefBoolean(Context context, String key) {
    SharedPreferences prefs = getPreferences(context);
    Boolean value = prefs.getBoolean(key, false);
    return value;
}

From source file:Main.java

public static int getBooleanInt(SharedPreferences prefs, String key, Boolean defValue) {
    return prefs.getBoolean(key, defValue) ? 1 : 0;
}

From source file:Main.java

private static boolean getBoolean(String key, Context context) {
    SharedPreferences settings = createSharedPreferences(context);
    return settings.getBoolean(key, false);
}