• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Exit an Application

 
Sreenu Vengala
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

Please help on how to exit an application..

Thanks
Srinu
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do a search for "exit application" in android forum; i believe this question has been asked before
 
SatishKumar Uppara
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can exit your application or activity by calling this.finish()
 
Minh Hoang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SatishKumar Uppara wrote:You can exit your application or activity by calling this.finish()


I'm new in Android!!
this.finish() in Activity only stop and destroy this activity, application still staying background (check by hold HOME button)
I used:
System.exit(0);
but it still appear there!
Is there any other way? Thanks!
 
Ksh Aggarwal
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Minh Hoang wrote:
SatishKumar Uppara wrote:You can exit your application or activity by calling this.finish()

I'm new in Android!!
this.finish() in Activity only stop and destroy this activity, application still staying background (check by hold HOME button)
I used:
System.exit(0);
but it still appear there!


That's how Android works. The user/developer is not given any way to actually exit the application. When you call 'finish', the application stack is just pushed to the background. It still exists in the memory. Android itself decides when to close the application(i.e. remove its instance from the memory) and generally this is done when your application becomes the oldest application which was not used for the longest time.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spare some time to go through this discussion;
@Ksh: welcome to JavaRanch!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic