Hi friends, I set up a dialog box with a Yes and No button, but only NO is displayed YES The button is not displayed, please suggest me
This is the code that I used in advance in advance
alertDialog.setButton("YES", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int which) {
Toast.makeText(getApplicationContext(), "You clicked on YES", Toast.LENGTH_SHORT).show();
}
});
alertDialog.setButton("NO bad", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(getApplicationContext(), "You clicked on NO", Toast.LENGTH_SHORT).show();
dialog.cancel();
}
});
source
share