I’ve been trying to set this alertDialog to a linearview by making it link to a xml file. But its not working. Any help would be appreciated, thanx
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Are you sure you want to exit?")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
MyActivity.this.finish();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
Do i get you right: You want to place a LinearLayout inside a AlertDialog?
Just replace
dialog_layoutwith your Layouts XML.Also you don’t need the
builder.setMessage("Are you sure you want to exit?")anymore.