Thanks a lot Jason and Justin. My game works fine on 1.6+, at least on
simulator. AFAIK that's API level 4, so I cannot use this method if I
wan to keep that compatibility:
@Override
public void onBackPressed() {
return;
}
So I will use the keyevent based method (JFTR again):
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() ==
0) {
// do something on back.
return true;
}
return super.onKeyDown(keyCode, event);
}
On 7 mayo, 18:46, Justin Anderson <[email protected]> wrote:
> Depending on the version of Android you are targeting, this will also be
> very
> helpful:http://android-developers.blogspot.com/2009/12/back-and-other-hard-ke...
>
> Thanks,
> Justin Anderson
> MagouyaWare Developerhttp://sites.google.com/site/magouyaware
>
>
>
>
>
>
>
> On Mon, May 7, 2012 at 7:28 AM, Jason Teagle <[email protected]> wrote:
> > One of these is that when the user press the back button of the phone -
> >> I mean that with a curved arrow-, the application is closed, so I want
> >> to ask for confirmation or something similar so, is there anyway to
> >> easy control this?
>
> > I believe this link will help you considerably:http://stackoverflow.com/*
> > *questions/4779954/disable-**back-button-in-android<http://stackoverflow.com/questions/4779954/disable-back-button-in-and...>
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to
> > android-developers@**googlegroups.com<[email protected]>
> > To unsubscribe from this group, send email to
> > android-developers+**[email protected]<android-developers%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en>
--
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