This is my code for creating a Dialog Box
public void onClick(View v)
{
try {
Builder dialog = new AlertDialog.Builder(context);
dialog.setTitle(R.string.dialog_title1);
dialog.setMessage(R.string.url);
dialog.setPositiveButton(R.string.dialog_ok, null);
dialog.show();
}
}
}
I want to add an EventListener to setPositiveButton (the OK button). When OK is clicked, my application should be closed i.e. the user should exit from app. Can anyone help me achieving this?
1 Answer