Maximizing AlertDialog?
I would like to show a Dialog that takes up as much screen space as possible.
So here's an example:
AlertDialog dialog = new AlertDialog.Builder(ctx)......create();
Window w = dialog.getWindow();
WindowManager.LayoutParams lp = w.getAttributes();
lp.width = 320;
lp.height = 480;
w.setAttributes(lp);
The problem is that it doesn't change anything. Why?
TIA.
+2
source to share
3 answers
You need to change AFTER window layout options setContentView. Anything you do in the window before (size / location) will be output when setContentView is called.
http://devstream.stefanklumpp.com/2010/07/android-display-dialogs-in-fullscreen.html
0
source to share