I am developing an application that when the button is pressed, it opens a dialog with OK and Cancel buttons.
It works fine.
When the user presses the back b
You need to override OnCancel method. This method calls on Back Key press. Here's code which works perfect to me.
AlertDialog alertDialog;
alertDialog.setOnCancelListener(new OnCancelListener()
{
@Override
public void onCancel(DialogInterface dialog)
{
// TODO Auto-generated method stub
dialog.dismiss();
}
});
Hope this will help you, and accept it if it is helpful to you.
Thanks..