Android SharedPreferences Get getPrefString(Context c, String key, String defValue)

Here you can find the source of getPrefString(Context c, String key, String defValue)

Description

get Pref String

Declaration

public static String getPrefString(Context c, String key,
            String defValue) 

Method Source Code

//package com.java2s;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class Main {
    public static String getPrefString(Context c, String key,
            String defValue) {// www.  j  a  va2 s .c om
        SharedPreferences sp = PreferenceManager
                .getDefaultSharedPreferences(c);
        return sp.getString(key, defValue);
    }
}

Related

  1. getPrefInt(SharedPreferences pref, String key, int default_value)
  2. getPrefObject(SharedPreferences pref, String key)
  3. getPrefObject(SharedPreferences pref, String key)
  4. getPrefBoolean(Context c, String key, boolean defValue)
  5. getPrefInt(Context c, String key, int defValue)
  6. getSaltFromPreferences(SharedPreferences prefs)
  7. getPinHashFromPreferences(SharedPreferences prefs)
  8. isRegistrationExpired(SharedPreferences prefs)
  9. asyncCommit( final SharedPreferences.Editor editor)