Using these lines in your activity: -
this.finish(); Process.killProcess( Process.myPid() );
it will kill your entire application (provided that it works in one process), it will also free up any associated memory.
A WARNING. On some phones, this may cause the bluetooth connectors to freeze if you use them.
David
source share