I want to close my application, so that it no longer runs in the background.
How to do that? Is this good practice on Android platform?
If I rely on the \"ba
YES! You can most certainly close your application so it is no longer running in the background. Like others have commented finish()
is the Google recommended way that doesn't really mean your program is closed.
System.exit(0);
That right there will close your application out leaving nothing running in the background.However,use this wisely and don't leave files open, database handles open, etc.These things would normally be cleaned up through the finish()
command.
I personally HATE when I choose Exit in an application and it doesn't really exit.