@Override public void onBackPressed() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage("You've pressed the back button\nThanks.") .setTitle("Back Pressed") .setCancelable(true); builder.create().show(); }
That's it. You're done. It create an AlertDialog when back button pressed.
0 komentar:
Post a Comment