Created
February 8, 2017 19:42
-
-
Save OrniNoor/53d51ac328171b972aba9785108c0645 to your computer and use it in GitHub Desktop.
Exit dialouge android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void exitByBackKey() { | |
AlertDialog alertbox = new AlertDialog.Builder(this) | |
.setMessage("Do you want to exit application?") | |
.setPositiveButton("Yes", new DialogInterface.OnClickListener() { | |
// do something when the button is clicked | |
public void onClick(DialogInterface arg0, int arg1) { | |
finish(); | |
//close(); | |
} | |
}) | |
.setNegativeButton("No", new DialogInterface.OnClickListener() { | |
// do something when the button is clicked | |
public void onClick(DialogInterface arg0, int arg1) { | |
} | |
}) | |
.show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment