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 isUsingLocalTime(Context context) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    return sp.getBoolean(PREF_LOCAL_TIMES, false);
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static boolean getReasonInDiskFlag(Context context) {
    SharedPreferences pref = context.getSharedPreferences(PREFS_WIBMO_IAP_SDK, Context.MODE_PRIVATE);
    return pref.getBoolean(PREF_HAS_ALARM_IAP_CANCEL_CODES, false);
}

From source file:Main.java

/**
 * @param context Context of Host application
 * @param prefFileName Preference file name
 * @param attributeName Attribute name/*from w  w w. j  a v a2  s.co m*/
 * @param defaultValue Default value of attribute
 * @return boolean Value
 */
public static boolean getFromSharedPreference(Context context, String prefFileName, String attributeName,
        boolean defaultValue) {
    SharedPreferences myPref = context.getSharedPreferences(prefFileName, Context.MODE_PRIVATE);
    return myPref.getBoolean(attributeName, defaultValue);
}

From source file:Main.java

public static boolean getVersionCode(Context context) {
    SharedPreferences sharedPreferences = context.getSharedPreferences(VERSION_S, Context.MODE_PRIVATE);
    return sharedPreferences.getBoolean(VERSION_S_K, false);
}

From source file:Main.java

public static boolean getPosterHelpStatus(Context context) {
    SharedPreferences sp = context.getSharedPreferences("poster_help", Activity.MODE_PRIVATE);
    boolean ret = sp.getBoolean("poster_help", false);
    return ret;//from w  w w.j  a v a 2 s .  c  o  m
}

From source file:Main.java

public static boolean getBooleanProperty(final Context context, String propertyName) {
    SharedPreferences preferences = context.getSharedPreferences("YTWPreferences", Context.MODE_PRIVATE);
    return preferences.getBoolean(propertyName, false);
}

From source file:Main.java

public static boolean getBooleanSp(Context context, String key) {
    SharedPreferences mySharedPreferences = context.getSharedPreferences("avalon", Activity.MODE_PRIVATE);
    return mySharedPreferences.getBoolean(key, false);
}