I have an application where on the home page I have buttons for navigation through the application.
On that page I have a button \"EXIT\" which when clicked should t
100% works fine. this is code for Exit your app onClick (Method)
Button exit = (Button)findViewById(R.id.exitbutton);
exit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
Toast.makeText(getApplicationContext(), "Closed Completely and Safely", Toast.LENGTH_LONG).show();
}
});