ISharedPreferences ISharedPreferences Interface


Interface for accessing and modifying preference data returned by GetSharedPreferences(String, FileCreationMode).

[Android.Runtime.Register("android/content/SharedPreferences", "", "Android.Content.ISharedPreferencesInvoker", ApiSince=1)]
public interface ISharedPreferences : Android.Runtime.IJavaObject, IDisposable
type ISharedPreferences = interface
    interface IJavaObject
    interface IDisposable


Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.


All All

Retrieve all values from the preferences.

Handle Handle

Gets the JNI value of the underlying Android object.

(Inherited from IJavaObject)


Contains(String) Contains(String)

Checks whether the preferences contains a preference.

Edit() 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.

GetBoolean(String, Boolean) GetBoolean(String, Boolean)

Retrieve a boolean value from the preferences.

GetFloat(String, Single) GetFloat(String, Single)

Retrieve a float value from the preferences.

GetInt(String, Int32) GetInt(String, Int32)

Retrieve an int value from the preferences.

GetLong(String, Int64) GetLong(String, Int64)

Retrieve a long value from the preferences.

GetString(String, String) GetString(String, String)

Retrieve a String value from the preferences.

GetStringSet(String, ICollection<String>) GetStringSet(String, ICollection<String>)
RegisterOnSharedPreferenceChangeListener(ISharedPreferencesOnSharedPreferenceChangeListener) RegisterOnSharedPreferenceChangeListener(ISharedPreferencesOnSharedPreferenceChangeListener)

Registers a callback to be invoked when a change happens to a preference.

UnregisterOnSharedPreferenceChangeListener(ISharedPreferencesOnSharedPreferenceChangeListener) UnregisterOnSharedPreferenceChangeListener(ISharedPreferencesOnSharedPreferenceChangeListener)

Unregisters a previous callback.

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Applies to