we can get some message from your strange result.when you pressed back button the A's onkeyup() was triggered.that is A shoud be activity.of course contents of above is my assumption which need your debug.in fact ,I am new to android and unfamiliar with the method of intent.setComponent.I'm sorry for that.
2010/5/13 inbrain <[email protected]> > Excuse me, what is A's status? And what I should be able to debug? > > On 13 May, 16:43, gujian <[email protected]> wrote: > > I think this situation depend on A'status.you can debug it with > "Log.d()"and > > then you can get your answer! > > > > 2010/5/13 inbrain <[email protected]> > > > > > > > > > > > > > 1) I'm using Android 1.6 > > > 2) Sorry, but I was not asking for workaround (which I think should be > > > clear from description). I wanted (and still want) to know why does it > > > work in this (IMO) BROKEN way! > > > > > I can not use onKeyDown() in my real-life code which suffers from this > > > problem. I only put this minimalistic sample to clearly show the > > > problem > > > > > On 12 May, 13:25, Mark Murphy <[email protected]> wrote: > > > > inbrainwrote: > > > > > Please read more carefully through my description. First I spawning > > > > > ANOTHER activity in the same task and pressing BACK button while IT > IS > > > > > VISIBLE. BACK button triggers both on this activity (effectively > > > > > closing it) and also shows toast (so triggers the second time) for > the > > > > > base activity (which is activity A) > > > > > > Don't use onKeyUp(). Use onBackPressed (Android 2.x) or onKeyDown() > > > > (Android 1.x). > > > > > > -- > > > > Mark Murphy (a Commons Guy)http://commonsware.com| > > > > http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > <http://github.com/commonsguyhttp://commonsware.com/blog%7Chttp://twit...> > > > > > > _Beginning Android 2_ from Apress Now Available! > > > > > > -- > > > > 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]<android-developers%[email protected]><android-developers%2Bunsubs > [email protected]> > > > > For more options, visit this group athttp:// > > > 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]<android-developers%[email protected]><android-developers%2Bunsubs > [email protected]> > > > 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 [email protected] > > To unsubscribe from this group, send email to > > [email protected]<android-developers%[email protected]> > > For more options, visit this group athttp:// > 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]<android-developers%[email protected]> > 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 [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

