Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Android
how to close an android application
Suzzane Pinto
Ranch Hand
Posts: 214
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi.
i want to quit from my android application when i press back of my mainactivity...
i have tried using finish();
Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NO_HISTORY); startActivity(intent);
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
Posts: 51
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi !
Try with this :
Intent i = new Intent(context, MainActivity.class); i.setAction(Intent.ACTION_MAIN); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addCategory(Intent.CATEGORY_LAUNCHER); context.startActivity(i);
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
Posts: 51
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi again !
You can try to use:
System.runFinalization(); System.exit(0);
But this is strongly not recommended
Bye!
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
AppWidget problem
My Custom Intents do not work
Start application on bootup android device !
cannot connect to the internet through yamba app
Displaying pdf files through our application
More...