You cannot simulate a press on the Home key. On Wed, Mar 10, 2010 at 8:23 AM, Wides <erich.weid...@gmail.com> wrote: > Hi, I have a requirement to implement an Exit button in my Android > application. I don't really care about killing the activity stack, I > just want to have the same effect as pressing the Home button. So that > application state is saved and can be returned to. I've tried making a > call to .... > > onKeyDown(KeyEvent.KEYCODE_HOME, new KeyEvent(0, > KeyEvent.KEYCODE_HOME)); > > But this doesn't accomplish anything, the PhoneWindowManager does not > get the key press... > > I assume I need to launch an Intent with the right info, but I haven't > been able to figure out how that would be done. > > Does anyone know how to do this ? > > Thanks, > Erich > > -- > 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 >
-- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- 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