Java android.content SharedPreferences fields, constructors, methods, implement or subclass

Example usage for Java android.content SharedPreferences fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.content SharedPreferences.

The text is from its open source code.

Implementation

android.content.SharedPreferences has the following implementations.
Click this link to see all its implementation.

Method

booleancontains(String key)
Checks whether the preferences contains a preference.
Editoredit()
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.
booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
MapgetAll()
Retrieve all values from the preferences.
booleangetBoolean(String key, boolean defValue)
Retrieve a boolean value from the preferences.
floatgetFloat(String key, float defValue)
Retrieve a float value from the preferences.
intgetInt(String key, int defValue)
Retrieve an int value from the preferences.
longgetLong(String key, long defValue)
Retrieve a long value from the preferences.
StringgetString(String key, @Nullable String defValue)
Retrieve a String value from the preferences.
SetgetStringSet(String key, @Nullable Set defValues)
Retrieve a set of String values from the preferences.
voidregisterOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener)
Registers a callback to be invoked when a change happens to a preference.
voidunregisterOnSharedPreferenceChangeListener(OnSharedPreferenceChangeListener listener)
Unregisters a previous callback.