The diagram you link to only shows the normal flow, not every possible
flow. If you read a bit further, you will see for example that
onCreate() is followed by onStart(), but onStart() may be followed
either by onResume() *OR* by onStop(), which clearly means that
onCreate->onStart->onStop->onDestroy is also a valid sequence of
events.



On Thu, Feb 26, 2009 at 4:59 AM, marmor <[email protected]> wrote:
>
> According to the activity lifecycle (
> http://code.google.com/android/reference/android/app/Activity.html#ActivityLifecycle
> ), I think I can assume that onDestroy would only be called on
> activities after onResume had been called.
>
> Also, I read some code from Android's OS itself, and I see that
> assumption there too (e.g. in CallLog module).
>
> I still think it's a bug.
>
> On Feb 26, 12:16 am, Marco Nelissen <[email protected]> wrote:
>> On Wed, Feb 25, 2009 at 1:36 PM, marmor <[email protected]> wrote:
>>
>> > Hi,
>>
>> > I think there's a bug involving using Tabs and Landscape/Portrait
>> > switching.
>>
>> > Using an app with TabHost, tab_1 is shown, onCreate and then onResume
>> > are called.
>> > When switching to tab_2: onPause(1), onCreate(2), onResume(2) are
>> > called.
>> > When switching to landscape mode: onPause(2), onDestroy(2), onDestroy
>> > (1) are called to close the app, and then onCreate(1), onCreate(2),
>> > onPause(2) are called.
>>
>> > I think this is the bug, android had created tab_1 but should have
>> > then called onResume(1), onPause(1).
>>
>> I don't think there is any guarantee that onCreate() will always be
>> followed by onResume(), especially since in this case the activity
>> isn't even showing, so why should it be resumed?
> >
>

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