I\'m trying to create a class KeyValueDB which stores methods for interacting with SharedPreferences, however I\'m running into a problem just defining the class. All I want th
You should pass a context there...
example of getting a string value:
public static String getUserName(Context ctx) { return getSharedPreferences(ctx).getString(PREF_USER_NAME, ""); }
where PREF_USER_NAME is the key and the second parameter is when it cant find the key it returns ""
PREF_USER_NAME
""