Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Exit an Application  RSS feed

 
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
 
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
 
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()
 
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!
 
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!
 
Those are the largest trousers in the world! Especially when next to this ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!