-1

I can set the button, the icon of the alert dialog.But I don't know how to change the size of the alert dialog.

RealMo
  • 1

1 Answers1

0

try this, just add setlayout() method after show()

AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(layout);
builder.setTitle("Title");
alertDialog = builder.create();
alertDialog.show();
alertDialog.getWindow().setLayout(600, 400); //change width and height.
suraj shinde
  • 230
  • 1
  • 7
  • 19
  • It likes the custom alert dialog.Your method is feasible,but need me to data loading and persistence.I prefer to change the system layout directly. – RealMo May 05 '17 at 14:45