On Tue, Oct 2, 2012 at 8:57 AM, Nitin Khanna <[email protected]> wrote:

> I have a couple of question regarding onRestoreInstanceState and
> onSaveInstanceState.
>
> 1) where do these methods fit the activity lifecycle? I have read a lot of
> documentation but there is no clear idea, except a broad statement that
>
when the state of the activity is to be saved
>
Labeled very clearly.
http://developer.android.com/guide/components/activities.html#SavingActivityState

> 2) Are onCreate and onRestoreInstanceState mutually exclusive?
>
What does that mean?

> 3) is onRestoreInstanceState called when the activity is destroyed?
>
No, why would you restore the state of something that was just destroyed?

> what does this mean?
>
What does what mean?

> an activity always destroyed except for scenarios when another activity is
> floating on top of current.
>
Huh?

> 4) onRestoreInstanceState appears to be called only from instrumentation
> in jelly bean. Is this no longer relevant to activity lifecycle?
>
The state callbacks are technically not part of the Activity lifecycle.
They're "special cases".

> 5) One thing that keeps on being mentioned is that onRestoreInstanceState is
> executed after start and onCreate before start. So if onCreate is called
> everytime, then is onRestoreInstanceState redundant?
>
No. onCreate means activity was created - do you init stuff.
onRestore means activity was created *and* was previously in use - so try
to restore it's state.

-------------------------------------------------------------------------------------------------
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