You guessed correctly. Where I wrote 'least', I should have written 'last'. But since you agree that both onPause() and onStop() will be called, Bob M. really has to change the wording in his blog. As it stood when I wrote that, it really did imply that ONLY onPause() is called, not onStop(). As such, where it attempts to lift the fog and dispel confusion, it only replaces one confusion with another.
And yes, you are right that this "the normal lifecycle". But you are wrong to deny the causal link between pressing Home and the lifecycle in turn causing onPause() and onStop() to be called. It is not only perfectly correct, but even important to understand the lifecycle as a more mediate sort of cause, the press of Home the more proximate, e.g., the one as formal, the other as efficient cause. But the cause most relevant to the developer (the OP) is that pressing Home causes onPause() and then onStop() to be called, since his Activity has not only lost 'focus', but also become invisible. The only danger of this POV is that it might lead the developer to forget that there are other external exents the lifecycle communicates to him via these callbacks; but coverage of these is where Bob M.'s post is particularly good, so I have nothing to add to that. I even think we can still hold out hope for him: once he understands the lifecycle this well, he may find that he really does not need to intercept the Home key, he can think of a better way to meet the customer requirement -- unless he is really unlucky with his choice of customer:( On Jun 8, 10:49 am, TreKing <[email protected]> wrote: > On Wed, Jun 8, 2011 at 12:31 PM, Indicator Veritatis <[email protected]>wrote: > > > But shouldn't it trigger onStop() too? After all, the application is > > no longer visible. And what about the Activity Stack? Doesn't pressing > > Home put the least recently used Activity on that stack? > > Yes and yes (assuming you meant "last" recently used) but the point is > neither of those actions is due to HOME being pressed - this is the > lifecycle. If you were to use a quick-launching app that allowed you to > launch a new app "B" while you were still on app "A", app "A" would pause > then stop and be placed on the history stack - it has nothing to do with the > fact that the activity coming up happens to be the Home app. In fact, > playing with my N1 with 2.3.4 shows that the *current* activity is place on > the history stack as soon as it's brought up, not when you go away from it. > > ------------------------------------------------------------------------------------------------- > 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

