Example usage for android.content SharedPreferences getString

List of usage examples for android.content SharedPreferences getString

Introduction

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

Prototype

@Nullable
String getString(String key, @Nullable String defValue);

Source Link

Document

Retrieve a String value from the preferences.

Usage

From source file:Main.java

/**
 * @param sharedPref//from  www  .java  2s .  c om
 * @return
 */
public static String getFlashCardJson(SharedPreferences sharedPref) {
    return sharedPref.getString(SAVED_FLASH_CARD, "");
}

From source file:Main.java

public static String loadLastPDFListUpdate(SharedPreferences sPref) {
    String savedText = sPref.getString(SAVED_LastPDFListUpdate, "");
    return savedText;
}

From source file:Main.java

public static String loadLastNewsfeedUpdate(SharedPreferences sPref) {
    String savedText = sPref.getString(SAVED_LastNewsfeedUpdate, "");
    return savedText;
}

From source file:Main.java

public static String loadLastPodcastUpdate(SharedPreferences sPref) {
    String savedText = sPref.getString(SAVED_LastPodcastUpdate, "");
    return savedText;
}

From source file:Main.java

public static String getName(Context context) {
    SharedPreferences sp = getSP(context);
    return sp.getString("name", "");
}

From source file:Main.java

public static String getLatitude(Context context) {
    SharedPreferences sp = getSP(context);
    return sp.getString("latitude", "0");
}

From source file:Main.java

public static String getPhone(Context context) {
    SharedPreferences sp = getSP(context);
    return sp.getString("phone", "");
}

From source file:Main.java

public static String getIcon(Context context) {
    SharedPreferences sp = getSP(context);
    return sp.getString("icon", "");
}

From source file:Main.java

public static String getLongitude(Context context) {
    SharedPreferences sp = getSP(context);
    return sp.getString("longitude", "0");
}

From source file:Main.java

public static String getNickName(Context context) {
    SharedPreferences sp = getSP(context);
    return sp.getString("nick", "");
}