Example usage for android.content SharedPreferences getFloat

List of usage examples for android.content SharedPreferences getFloat

Introduction

In this page you can find the example usage for android.content SharedPreferences getFloat.

Prototype

float getFloat(String key, float defValue);

Source Link

Document

Retrieve a float value from the preferences.

Usage

From source file:Main.java

public static float getFloat(Context context, String key, float defValue) {
    SharedPreferences sp = getSharedPreferences(context);
    return sp.getFloat(key, defValue);
}

From source file:Main.java

public static Float getFloatFromSP(Context context, String key) {
    SharedPreferences sp = getSharedPreferences(context);
    return sp.getFloat(key, 0.0f);
}

From source file:Main.java

public static Float getFloatFromSP(Context context, String key, float def) {
    SharedPreferences sp = getSharedPreferences(context);
    return sp.getFloat(key, def);
}

From source file:Main.java

public static float getWindowX(Context context) {
    SharedPreferences sp = context.getSharedPreferences(PREFS_CACHE_ONE, 0);
    return sp.getFloat("x", 0);
}

From source file:Main.java

public static float getFloat(Context context, String key, float defValue) {
    SharedPreferences sharedPreferences = context.getSharedPreferences(PREFS_NAME, 0);
    return sharedPreferences.getFloat(key, defValue);
}

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 float getSharedPreferencesFloat(Context context, String key, float _default) {
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
    return preferences.getFloat(key, _default);
}

From source file:Main.java

public static float pullSen(Context context) {
    SharedPreferences sp = context.getSharedPreferences(CONFIG, Context.MODE_PRIVATE);
    return sp.getFloat(KEY_PS, DEFAULT_PULL_SENSITIVITY);
}

From source file:Main.java

public static float readFloat(Context context, String key, float defaultValue) {
    SharedPreferences pre = context.getSharedPreferences(STORE_NAME, Context.MODE_PRIVATE);
    return pre.getFloat(STORE_KEY_PREFIX + key, defaultValue);
}

From source file:Main.java

public static float getPreference(Context context, String key, float defaultValue) {
    SharedPreferences pref = getPreferences(context);
    return pref.getFloat(key, defaultValue);
}