If you want to finish an activity when pressing HOME, you can achieve
this with the manifest flag: finishOnTaskLaunch = true (you should
also look at allowTaskReparenting if you use task affinities).

On Oct 1, 12:01 pm, MrSnowflake <[EMAIL PROTECTED]> wrote:
> On 1 okt, 04:06, hackbod <[EMAIL PROTECTED]> wrote:> But keep in mind that 
> the user can still get out of your application
> > with the HOME key, and there is absolutely no way for you to prevent
> > that.
>
> That seems to be true, but there is const: KeyEvent.KEYCODE_HOME. I
> have tried anything with this yet, but why is it there if it isn't
> doing anything? Just to make it possible to find out the user pressed
> home to finish() the activity?
>
>
>
> > On Sep 30, 1:01 pm, plusminus <[EMAIL PROTECTED]> wrote:
>
> > > overwrite onKeyDown of your Activity and put a case
> > > KeyEvent.KEYCODE_BACK to a switch for the keycode-parameter. Return
> > > true in that case.
>
> > > Regards, plusminus
> > > # anddev.org | Worlds largest Android Community
>
> > > On Sep 30, 1:58 pm, april <[EMAIL PROTECTED]> wrote:
>
> > > > My application needs to send several request to server. I don't want
> > > > user to click "back" key of the phone during  sending process.
>
> > > > Is there any way I can block it ?
>
> > > > If application is doing something, user click "back", what is the life
> > > > cycle of activity it would be?
>
> > > > Thanks!
>
> > > > April
--~--~---------~--~----~------------~-------~--~----~
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