The below code should work for triggering the home screen.
Having said that, unless you have a custom device lacking home and
back buttons, this is probably a bad idea. As is an exit button. And
an exit button that doesn't really exit and just dumps you to the home
screen is baffling. Those things just go against how almost every
Android app works.

Thanks
Mike dg

 Intent i = new Intent();
        i.setAction(Intent.ACTION_MAIN);
        i.addCategory(Intent.CATEGORY_HOME);
        this.startActivity(i);

On Mar 10, 1:14 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> Wides wrote:
> > Hi, I have a requirement to implement an Exit button in my Android
> > application.
>
> Tell whoever gave you that requirement to eliminate the requirement.
>
> http://www.androidguys.com/2010/01/13/android-development-its-just-di...
>
> > I don't really care about killing the activity stack, I
> > just want to have the same effect as pressing the Home button.
>
> Then let the user press the HOME button. All Android devices should have
> one.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Training...At Your Office:http://commonsware.com/training

-- 
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

Reply via email to