Example usage for Java android.content SharedPreferences fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | contains(String key) Checks whether the preferences contains a preference. |
Editor | edit() Create a new Editor for these preferences, through which you can make modifications to the data in the preferences and atomically commit those changes back to the SharedPreferences object. |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
Map | getAll() Retrieve all values from the preferences. |
boolean | getBoolean(String key, boolean defValue) Retrieve a boolean value from the preferences. |
float | getFloat(String key, float defValue) Retrieve a float value from the preferences. |
int | getInt(String key, int defValue) Retrieve an int value from the preferences. |
long | getLong(String key, long defValue) Retrieve a long value from the preferences. |
String | getString(String key, @Nullable String defValue) Retrieve a String value from the preferences. |
Set | getStringSet(String key, @Nullable Set Retrieve a set of String values from the preferences. |
void | registerOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener) Registers a callback to be invoked when a change happens to a preference. |
void | unregisterOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener) Unregisters a previous callback. |