By : Ketan Bhimani
292 preference name as a variable (in a base class or header) so that
you can reuse the name across multiple activities. For examplepublic static final String PREFERENCE_FILENAME = “AppPrefs”;
Searching and Reading PreferencesReading preferences is straightforward. Simply retrieve the
SharedPreferences instance you want to read. You can check for a
preference by name, retrieve strongly typed preferences, and
register to listen for changes to the preferences. Table describes
some helpful methods in the SharedPreferences interface.Important android.content.SharedPreferences MethodsAdding, Updating, and Deleting PreferencesTo change preferences, you need to open the preference Editor,
make your changes, and commit them. Table describes some
helpful methods in the Shared Preferences. Editor interface.