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 void clearLocalesIndexed(Context context) {
    context.getSharedPreferences(INDEX, 0).edit().clear().commit();
}

From source file:Main.java

public static SharedPreferences getSharedPreference(Context context) {
    return context.getSharedPreferences(PRFERENCE_NAME_SYT, Context.MODE_PRIVATE);
}

From source file:Main.java

public static SharedPreferences getSharedPreference(String name, Context context) {
    return context.getSharedPreferences(name, Context.MODE_PRIVATE);
}

From source file:Main.java

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

From source file:Main.java

public static boolean getBoolean(Context context, String key) {
    return context.getSharedPreferences("fq", Context.MODE_PRIVATE).getBoolean(key, false);
}

From source file:Main.java

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

From source file:Main.java

public static void setWelcomeShown(final Context ctx) {
    ctx.getSharedPreferences("_welcome_dialog_shown", Context.MODE_PRIVATE).edit().putBoolean("shown", true)
            .commit();//from ww w .  j ava2 s .c om
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static boolean setLastDispalyTime(Context context, long value) {
    return context.getSharedPreferences(DIGG_PREFERENCES, 0).edit().putLong("last_dig_time", value).commit();
}