Example usage for android.content Context getSharedPreferences

List of usage examples for android.content Context getSharedPreferences

Introduction

In this page you can find the example usage for android.content Context getSharedPreferences.

Prototype

public abstract SharedPreferences getSharedPreferences(File file, @PreferencesMode int mode);

Source Link

Document

Retrieve and hold the contents of the preferences file, returning a SharedPreferences through which you can retrieve and modify its values.

Usage

From source file:Main.java

public static SharedPreferences getPreferences(Context context) {
    return context.getSharedPreferences(PREF_NAME, MODE);
}

From source file:Main.java

private static SharedPreferences getSP(Context context) {
    return context.getSharedPreferences(CONFIG_NAME, Context.MODE_PRIVATE);
}

From source file:Main.java

private static SharedPreferences getSharedPreferences(final Context context) {
    return context.getSharedPreferences(PREFERENCE_FILE_NAME, Context.MODE_PRIVATE);
}

From source file:Main.java

private static SharedPreferences getSP(Context context) {
    return context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
}

From source file:Main.java

public static long d(Context arg3, String arg4) {
    return arg3.getSharedPreferences("marsroot", 0).getLong(arg4, 0);
}

From source file:Main.java

private static SharedPreferences getSharedPreferences(Context context) {
    return context.getSharedPreferences(WEATHER_PREFERENCES, Context.MODE_PRIVATE);
}

From source file:Main.java

public static int c(Context arg2, String arg3) {
    return arg2.getSharedPreferences("marsroot", 0).getInt(arg3, 0);
}

From source file:Main.java

public static boolean readFromPrefsBoolean(Context ctx, String key) {
    return ctx.getSharedPreferences(ctx.getApplicationInfo().packageName, ctx.MODE_PRIVATE).getBoolean(key,
            false);/*from w  ww. j a  v a 2 s. com*/
}

From source file:Main.java

public static SharedPreferences getSharedPreferences(Context context) {
    return context.getSharedPreferences("config", Context.MODE_PRIVATE);
}

From source file:Main.java

/**
 * Get the log in settings//from  ww w  .ja v  a  2  s  . com
 * @param context The Context to use
 * @return The log in settings
 */
private static SharedPreferences getLogInSettings(Context context) {
    return context.getSharedPreferences(USER_INFO_PREFS_NAME, 0);
}