I am trying to add an alertdialog within an alertdialog.But not able to see the second alertdialog..please help me here is my code shown
AlertDialog alertDia
It is gonna be a late answer but you can create an AlertDialog inside onClickListener just like this:
public void onClick(DialogInterface dialog, int which) {
if (options[which] == "Manage") {
//Do smtg
} else {
dialog.dismiss();
final AlertDialog alert;
AlertDialog.Builder dialog2 = new AlertDialog.Builder(CategoryPage.this);
alert = dialog2.create();
alert.setTitle("Delete " + title + "?");
alert.setMessage("Are you sure you want to delete this category?");
alert.setButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
Toast.makeText(CategoryPage.this, "YESS", Toast.LENGTH_LONG).show();
}
});
alert.setButton2("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
alert.dismiss();
}
});
alert.show();
}
}