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 isMapHintVisible(Context context) {
    SharedPreferences sharedPref = context.getSharedPreferences(KEY_SHOW_MAP_HINT, Context.MODE_PRIVATE);
    return sharedPref.getBoolean(KEY_SHOW_MAP_HINT, true);
}

From source file:Main.java

public static boolean isShowWheelchairIcon(Context context) {
    SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(context);
    return null != mPrefs && mPrefs.getBoolean("load_wheelchair_icon", true);
}

From source file:Main.java

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

From source file:Main.java

public static boolean isUserLoggedIn(Context context) {
    SharedPreferences sharedPreferences = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
    return sharedPreferences.getBoolean(USER_LOGGED_IN, false);
}

From source file:Main.java

public static boolean isGuided(Context context) {
    SharedPreferences pref = context.getSharedPreferences(context.getPackageName() + "_preferences", 0);
    return pref.getBoolean(IS_GUIDED, false);
}

From source file:Main.java

public static boolean getBoolean(Context context, String key, boolean defaultValue) {
    SharedPreferences settings = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE);
    return settings.getBoolean(key, defaultValue);
}

From source file:Main.java

public static boolean getboolean(Context context, String key, boolean defualt) {
    SharedPreferences sharedPreferences = context.getSharedPreferences(SPACENAMA, context.MODE_PRIVATE);
    return sharedPreferences.getBoolean(key, defualt);
}

From source file:Main.java

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

From source file:Main.java

public static boolean isFirstFullScreen(Context ctt) {
    if (ctt != null) {
        SharedPreferences sp = ctt.getSharedPreferences(PREFERENCES_FIRST_IN, Context.MODE_PRIVATE);
        return sp.getBoolean(KEY_FIRST_FULL_SCREEN, true);
    }//from   w  w  w .ja v a 2 s .c  om
    return false;
}

From source file:Main.java

public static boolean isLogged(Context context) {
    SharedPreferences sharedPreferences = context.getSharedPreferences(SHERED_NAME, Context.MODE_PRIVATE);
    return sharedPreferences.getBoolean(SHARED_KEY_IS_LOGGED, false);
}