How to Exit an Application

Put your problem here if it does not fit any of the other categories.

How to Exit an Application

Postby srinuv28 » Wed Dec 02, 2009 2:41 am

Hi..

Please help on how to exit an application..
It's urgent..please..

Thanks
Srinu
srinuv28
Developer
Developer
 
Posts: 36
Joined: Wed Nov 04, 2009 4:04 am

Top

Postby virtual » Wed Dec 02, 2009 5:45 am

Check Intent flags in the doc. And choose the one that suits you.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. Intent intent = new Intent(this, New Activity.class);
  3.  
  4. intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  5.  
  6. //start the new activity
  7.  
  8. //finish this one
  9.  
  10.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4



This is how I am exiting the application. And is working fine
Regards,
Virtual
virtual
Developer
Developer
 
Posts: 26
Joined: Tue Mar 24, 2009 11:20 am

Postby padde » Wed Dec 02, 2009 6:31 am

Whats about the good old "finish()" ?!?
Sending an intent to quit .. you got to be kidding.... what if you dont want to start another activity?!
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby virtual » Wed Dec 02, 2009 7:56 am

padde wrote:Whats about the good old "finish()" ?!?
Sending an intent to quit .. you got to be kidding.... what if you dont want to start another activity?!


Off course we have to call finish(). There is no other way.
Regards,
Virtual
virtual
Developer
Developer
 
Posts: 26
Joined: Tue Mar 24, 2009 11:20 am

Postby srinuv28 » Wed Dec 02, 2009 10:33 am

Thanks for replying....
srinuv28
Developer
Developer
 
Posts: 36
Joined: Wed Nov 04, 2009 4:04 am

Postby Zeba Momin » Thu Dec 10, 2009 7:56 am

Hi...
finish() will close my current activity... But i wanna exit from my android app i.e. close all the activities and also the main application.
How do I do dat?
Plzzz help..Thank you.
Zeba Momin
Developer
Developer
 
Posts: 49
Joined: Thu Sep 17, 2009 6:53 am

Top

Postby nhenze » Thu Dec 10, 2009 11:02 am

Have you tried System.exit()
nhenze
Freshman
Freshman
 
Posts: 9
Joined: Thu Dec 10, 2009 10:34 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot], Google Feedfetcher and 18 guests