Saving Activity State Using Shared Preferences in Android
If you want to save Activity information that doesn’t need to be shared with other components (e.g., class instance variables), you can call Activity.getPreferences() without specifying a Shared Preferences name. This returns a Shared Preference using the calling Activity’s class name as the Shared Preference name