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 shouldShowSessionFeedbackReminders(final Context context) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    return sp.getBoolean(PREF_SHOW_SESSION_FEEDBACK_REMINDERS, true);
}

From source file:Main.java

public static boolean hasDeclinedWifiSetup(Context context) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    return sp.getBoolean(PREF_DECLINED_WIFI_SETUP, false);
}

From source file:Main.java

public static boolean shouldShowSessionReminders(final Context context) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    return sp.getBoolean(PREF_SHOW_SESSION_REMINDERS, true);
}

From source file:Main.java

public static boolean isDataBootstrapDone(final Context context) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    return sp.getBoolean(PREF_DATA_BOOTSTRAP_DONE, false);
}

From source file:Main.java

public static boolean isPassphraseInitialized(Context context) {
    SharedPreferences preferences = context.getSharedPreferences(PREFERENCES_NAME, 0);
    return preferences.getBoolean("passphrase_initialized", false);
}

From source file:Main.java

public static boolean isWelcomeDone(final Context context) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    return sp.getBoolean(PREF_WELCOME_DONE, false);
}

From source file:Main.java

public static boolean hasUserRefusedSignIn(final Context context) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    return sp.getBoolean(PREF_USER_REFUSED_SIGN_IN, false);
}

From source file:Main.java

public static boolean getBoolean(String fileName, Context context, String keyId, boolean defaultValue) {
    SharedPreferences sharedPreferences = context.getSharedPreferences(fileName, Context.MODE_PRIVATE);
    return sharedPreferences.getBoolean(keyId, defaultValue);
}

From source file:Main.java

public static boolean isLoggedIn(final Context context) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    return sp.getBoolean(PREF_LOGGED_IN, false);
}

From source file:Main.java

public static boolean wasDebugWarningShown(final Context context) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    return sp.getBoolean(PREF_DEBUG_BUILD_WARNING_SHOWN, false);
}