Methods Summary |
---|
public boolean | contains(java.lang.String key)Checks whether the preferences contains a preference.
|
public android.content.SharedPreferences$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.
Note that you must call {@link Editor#commit} to have any
changes you perform in the Editor actually show up in the
SharedPreferences.
|
public java.util.Map | getAll()Retrieve all values from the preferences.
Note that you must not modify the collection returned
by this method, or alter any of its contents. The consistency of your
stored data is not guaranteed if you do.
|
public boolean | getBoolean(java.lang.String key, boolean defValue)Retrieve a boolean value from the preferences.
|
public float | getFloat(java.lang.String key, float defValue)Retrieve a float value from the preferences.
|
public int | getInt(java.lang.String key, int defValue)Retrieve an int value from the preferences.
|
public long | getLong(java.lang.String key, long defValue)Retrieve a long value from the preferences.
|
public java.lang.String | getString(java.lang.String key, java.lang.String defValue)Retrieve a String value from the preferences.
|
public java.util.Set | getStringSet(java.lang.String key, java.util.Set defValues)Retrieve a set of String values from the preferences.
Note that you must not modify the set instance returned
by this call. The consistency of the stored data is not guaranteed
if you do, nor is your ability to modify the instance at all.
|
public void | registerOnSharedPreferenceChangeListener(android.content.SharedPreferences$OnSharedPreferenceChangeListener listener)Registers a callback to be invoked when a change happens to a preference.
Caution: The preference manager does
not currently store a strong reference to the listener. You must store a
strong reference to the listener, or it will be susceptible to garbage
collection. We recommend you keep a reference to the listener in the
instance data of an object that will exist as long as you need the
listener.
|
public void | unregisterOnSharedPreferenceChangeListener(android.content.SharedPreferences$OnSharedPreferenceChangeListener listener)Unregisters a previous callback.
|