• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exit the Application

 
prazannag Kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Activity can be closed using the method finish(). In which method is used to exit the application completely.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
prazannag Kumar wrote:which method is used to exit the application completely.

"How to exit an application?" has been a topic of debate. Generally, you are advised to not provide an option to quit the application. For a more detailed answer take a look at : Quitting an Application: Is that frowned upon?
 
Piyush Patel
Ranch Hand
Posts: 127
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
finish();
System.exit(0).

Though you can call System.exit() to terminate the JVM instance, you should not do it.
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you exit an activity, an event fires that notifies you to put away all your toys. So you can release all the resources that would otherwise subtract from your overall abilities.

Releasing the activity code itself and the internal structures that support it is a different matter. The main reason why mobile apps are "continuously running" is that with the fairly limited processing power of many mobile CPUs, it's much faster to resume an app than to launch it. And Android, for one, has received its fair share of criticism (unjustified, I think) for being slow.

The other reason for not shutting down an app is that mobile apps tend to be more in the nature of resources to be tapped (such as the phone book display). As opposed to sit-down-and-work-with-it sessions, such as desktop word processing. So it's preferable that they be light and easy to both bring up and put away.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic