Example usage for android.content SharedPreferences getLong

List of usage examples for android.content SharedPreferences getLong

Introduction

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

Prototype

long getLong(String key, long defValue);

Source Link

Document

Retrieve a long value from the preferences.

Usage

From source file:Main.java

public static long getRegionID(Context context) {
    SharedPreferences sp = getSP(context);
    return sp.getLong("currentRegionID", 510100);
}

From source file:Main.java

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

From source file:Main.java

public static Long getLongFromSP(Context context, String key) {
    SharedPreferences sp = getSharedPreferences(context);
    return sp.getLong(key, 0L);
}

From source file:Main.java

public static Long getLongFromSP(Context context, String key, long def) {
    SharedPreferences sp = getSharedPreferences(context);
    return sp.getLong(key, def);
}

From source file:Main.java

public static long getLongValue(Context context, String name, long defValue) {
    SharedPreferences pref = getPref(context, DEF_PREF_NAME);
    return pref.getLong(name, defValue);
}

From source file:Main.java

private static long getLong(String key, Context context) {
    SharedPreferences settings = createSharedPreferences(context);
    return settings.getLong(key, -1l);
}

From source file:Main.java

public static long getGetDooiooAllTime(Context context) {
    SharedPreferences sp = context.getSharedPreferences(PREFS_CACHE_ONE, 0);
    return sp.getLong("getDooiooAllTime", 0);
}

From source file:Main.java

public static long getDownloadSuccessTime(Context context) {
    SharedPreferences sp = context.getSharedPreferences(PREFS_CACHE_ONE, 0);
    return sp.getLong("downloadSuccessTime", 0);
}

From source file:Main.java

public static long getDownloadId(Context context) {
    SharedPreferences pref = context.getSharedPreferences(PREFERENCE_NAME, 0);
    return pref.getLong(CONFIG_DOWNLOAD_ID, 0);
}

From source file:Main.java

public static long getSharedPreferencesLong(Context context, String key, long _default) {
    SharedPreferences preferences = context.getSharedPreferences(PREFS_NAME, 0);
    return preferences.getLong(key, _default);
}