Saving Activity State

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. Access to the returned Shared Preferences map is restricted to the calling Activity; each Activity supports a single unnamed Shared Preferences object.

Listing 6-5 shows how to use the Activity's private Shared Preference.

Farlhqu akc Prrlcitnccs

Auto refresh

•iflen ic mm nn uRgindlc LipriATlr^

Refresh frequency

JYtqueniv ai whltii ts rtfrtih earlhquah« -¡it

Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide


Post a comment