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 getBoolean(String preName, Context context, String key) {
    SharedPreferences pre = context.getSharedPreferences(preName, Context.MODE_PRIVATE);
    return pre.getBoolean(key, false);
}

From source file:Main.java

public static boolean isAutoSyncChecked(Context context) {
    SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
    return settings.getBoolean("autoSync_pref", false);
}

From source file:Main.java

public static Boolean getBoolean(Context mContext, String key) {
    SharedPreferences sp = mContext.getSharedPreferences("atguigu", Context.MODE_PRIVATE);
    return sp.getBoolean(key, false);
}

From source file:Main.java

public static boolean getApplicationBooleanPreferences(Context context, String key) {
    SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS_NAME, 0);
    return sharedPreferences.getBoolean(key, false);
}

From source file:Main.java

public static boolean isMyTBAEnabled(Context context) {
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
    return prefs.getBoolean(PREF_MYTBA_ENABLED, false);
}

From source file:Main.java

public static boolean isOnlyDestop(Context context) {
    SharedPreferences sp = context.getSharedPreferences(CONFIG, Context.MODE_PRIVATE);
    return sp.getBoolean(KEY_ONLY_DESTOP, false);
}

From source file:Main.java

public static boolean getBoolean(Context ctx, String key, boolean defaultValue) {
    SharedPreferences spf = ctx.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);

    return spf.getBoolean(key, defaultValue);
}

From source file:Main.java

public static boolean isInitialised(Context context) {
    SharedPreferences prefs = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE);
    return prefs.getBoolean(PREF_INITIALISED, false);
}

From source file:Main.java

public static boolean isFirstRun(Context context) {
    SharedPreferences prefs = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE);
    return prefs.getBoolean(PREF_FIRST_RUN, true);
}

From source file:Main.java

public static boolean getSharedPreferencesBoolean(Context context, String key, boolean _default) {
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
    return preferences.getBoolean(key, _default);
}