Your blog post IS the best explanation I have seen to date of what the
Home key really means. I thought it was particularly interesting that
it emphasized something I have been dimly aware of but keep
forgetting: unlike the Back key, pressing Home does NOT cause finish()
to be called. I assume from your description that it triggers only one
lifecycle callback, onPause(). It doesn't even itself trigger
onStop(), which may or may not follow.

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?

In fact, when I put Log.d statements in my main Activity for both
onPause() and onStop(), I see both get called when I press the Home
key.

On Jun 8, 5:13 am, Mark Murphy <[email protected]> wrote:
> On Wed, Jun 8, 2011 at 7:20 AM, Mark Murphy <[email protected]> wrote:
> > On Wed, Jun 8, 2011 at 2:31 AM, Droid <[email protected]> wrote:
> >> I need to know when the home button is pressed too (otherwise my app
> >> returns to visibility again and again for ever).
>
> > Then fix your bug.
>
> >> (Please don't tell me I need to design my app
> >> 'properly', I have been Android dev for over a year now)
>
> > Tough. Design your app properly.
>
> I just wrote up a blog post about why you should not care about the
> HOME button and how better to solve this "problem":
>
> http://commonsware.com/blog/2011/06/08/please-ignore-home-button.html
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android 3.0 Programming Books:http://commonsware.com/books

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