On Wed, Sep 29, 2010 at 8:45 PM, sujith <[email protected]> wrote:

> so what is the exact purpose of these three??
>

SharedPreferences are for simple persistent settings storage. Like the home
page on a Browser that should be available every time the user opens the
app. These are just key->value pairs designed to hold simple things.

Bundle is a way of storing data to either pass to another Context (another
Activity, Service, etc) or to save and restore your own current state in
onSaveInstanceState and onRestoreInstance state. This data is NOT persistent
and used while the application is in use.

onRetainNonConfigurationInstance() is useful for keeping an object reference
alive while the system kills and restores your Activity during an
orientation change. This is useful for objects that are expensive to
construct or shouldn't be kill and restarted (things like AsyncTasks), where
using a Bundle would not make sense.

Hope that helps.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to