This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Android and the fly likes how to close an android application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "how to close an android application" Watch "how to close an android application" New topic
Author

how to close an android application

Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
hi.

i want to quit from my android application when i press back of my mainactivity...
i have tried using finish();

but still no result...
when i start my app it opens some activity in stack and from splash screen

looking for suggestions

Przemek Boryka
Ranch Hand

Joined: Dec 06, 2011
Posts: 51

Hi !

Try with this :



This part of code, will start "MainActivity" and set it on the first place on the stack. I used this code in boot up receiver to automatic launch app.

Bye, I hope this will help you
Przemek Boryka
Ranch Hand

Joined: Dec 06, 2011
Posts: 51

Hi again !

You can try to use:



But this is strongly not recommended

Bye!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to close an android application