Example usage for android.content Context MODE_PRIVATE

List of usage examples for android.content Context MODE_PRIVATE

Introduction

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

Prototype

int MODE_PRIVATE

To view the source code for android.content Context MODE_PRIVATE.

Click Source Link

Document

File creation mode: the default mode, where the created file can only be accessed by the calling application (or all applications sharing the same user ID).

Usage

From source file:Main.java

public static void putString(Context context, String key, String values) {
    SharedPreferences sp = context.getSharedPreferences("kieye", Context.MODE_PRIVATE);
    sp.edit().putString(key, values).commit();
}

From source file:Main.java

public static void putString(Context context, String key, String values) {
    SharedPreferences sp = context.getSharedPreferences("liu", Context.MODE_PRIVATE);
    sp.edit().putString(key, values).commit();

}

From source file:Main.java

public static void putBoolean(Context context, String key, boolean values) {
    SharedPreferences sp = context.getSharedPreferences("xiaolu", Context.MODE_PRIVATE);
    sp.edit().putBoolean(key, values).commit();
}

From source file:Main.java

public static void putBoolean(Context context, String key, boolean value) {
    SharedPreferences sp = context.getSharedPreferences(key, Context.MODE_PRIVATE);
    SharedPreferences.Editor editor = sp.edit();
    editor.putBoolean(key, value);/*from   w w  w.  j av a2 s.  c  om*/
    editor.apply();
}

From source file:Main.java

public static float getFloat(String preName, Context context, String key) {
    SharedPreferences pre = context.getSharedPreferences(preName, Context.MODE_PRIVATE);
    return pre.getFloat(key, 0.0f);
}

From source file:Main.java

public static void putBoolean(Context context, String key, boolean values) {
    SharedPreferences sp = context.getSharedPreferences("liu", Context.MODE_PRIVATE);
    sp.edit().putBoolean(key, values).commit();

}

From source file:Main.java

public static void putBoolean(Context context, String key, boolean value) {
    SharedPreferences sp = context.getSharedPreferences("andy", Context.MODE_PRIVATE);
    sp.edit().putBoolean(key, value).commit();
}

From source file:Main.java

public static void putString(Context context, String key, String value) {
    SharedPreferences sp = context.getSharedPreferences("superlol", Context.MODE_PRIVATE);
    sp.edit().putString(key, value).commit();

}

From source file:Main.java

public static void setDeskEffect(Context context, int tap) {
    SharedPreferences preferences = context.getSharedPreferences("DeskEffect", Context.MODE_PRIVATE);
    preferences.edit().putInt("DeskEffectItem", tap).commit();
}

From source file:Main.java

public static void putPlaymode(Context context, String key, int value) {
    SharedPreferences sp = context.getSharedPreferences("atguigu", Context.MODE_PRIVATE);
    sp.edit().putInt(key, value).commit();

}