> > May be I will nd up using API level 5... is there any place with stats > about SDK usage to know how many market I will lost in that case? >
According to this link, you will hit 99% of the devices out there if you target Android 2.1 or newer... http://developer.android.com/resources/dashboard/platform-versions.html Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Wed, May 9, 2012 at 1:14 PM, Fran <fmmar...@gmail.com> wrote: > Hi Justin, > > Nice to read you again. I think you have miss understood me, probably > cause I did not explain myself right neither: my English is not the > best one exactly... > > The method linked by Jason uses onBackPressed() ONLY, so what I meant > is that I cannot use that method if I want to kept backward > compatibility, so I need to use the other one proposed by you that > relies on onKeyDown. Yes, it also uses onBackPressed, but I though it > was clear what i wanted to say just pasting the first lines of code of > each proposed solution. > > Anyway It works fine in my Samsung GS2, and also in a 2.1 emulator, > but it does not on a 1.6 emulator. At least not with my code. > > Both versions calls to onBackPressed as expected, but while on 2.1+ > Android does not close the application after that call, in 1.6 it does > it. > > I have also additional problems with this: when I try to get back from > pause on 1.6, the application crashes, but it still works fine in > 2.1+. > > May be I will nd up using API level 5... is there any place with stats > about SDK usage to know how many market I will lost in that case? > > Best regards and thanks again by your help, > > > On May 8, 5:12 pm, Justin Anderson <magouyaw...@gmail.com> wrote: > > > 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; > > > } > > > > That's not true... Set your target API level to something high enough > that > > you can use the onBackPressed. Did you read the link I gave you? It > > specifically addresses this and tells you how to use both depending on > the > > API level. > > > > Thanks, > > Justin Anderson > > MagouyaWare Developerhttp://sites.google.com/site/magouyaware > > > > > > > > > > > > > > > > On Tue, May 8, 2012 at 7:01 AM, Fran <fmmar...@gmail.com> wrote: > > > 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; > > > } > > -- > 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 > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en