How to close ( Exit ) application on a button Click ?

by   SJRANJAN

Set the "OnClick" property of button to "btnExit_onClick" and add the following code in your java class.

    public void btnExit_onClick(View view){
        finish();
        System.exit(0);
    }

Now the button will close the application on click event.

Search

You may like...

How to change title of activity in Android ?

How to change title of activity in Android ?...


How to set orientation for activities ?

Learn how to set orientation for activities in android application....