Complete shutting down of Android app when any form of exiting is done i.e. using HOME, SWITCH and BACK button
<p>I'm building an Android app specifically a log in page whereby I'd like the app to completely shut down the app if the user was to exit the log in page in any way i.e. using the SWITCH, HOME or BACK buttons. </p>

<p>The only time the app should not completely shut down should be when user successfully logs in i.e. when the custom created log in button or enter button is pressed.</p>

<p>I've been able to do successfully shut down the app but in shuts down even when the user successfully logs. It isn't meant to do this.</p>

<p>Below is my code for the complete shut down - I took over the onDestroy(), onBackPressed(), finish() and onStop() methods:</p>

<pre><code>    // Deal with back button
public void onBackPressed() {
    System.runFinalizersOnExit(true);

    System.exit(0);     
}

// Deal with exiting of app
public void finish() {

    System.runFinalizersOnExit(true);

    System.exit(0);

}

// Deal with exiting of app
public void onDestroy() {
    System.runFinalizersOnExit(true); 

    System.exit(0);
}

// Deal with exiting of app
public void onStop() {
    System.runFinalizersOnExit(true); 

    System.exit(0);
}
</code></pre>

<p>DOES ANYONE HAVE ANY IDEAS REGARDING MY ISSUE</p>

<p>YOUR ASSISTANCE IS GREATLY APPRECIATED</p>
