I have a main activity, that when I click on a button, starts a new activity, i used the following code to do so:
Intent intent = new Intent(this, SettingsAc
This closes the entire application:
this.finish();