After making your desired changes, use getWindow().setAttributes() to
install the new values.
Note that, though you can force a specific size through the width and
height fields, in general the correct way to do this is let the window
do its normal layout and determine the window size automatically that
way. If you have a single view in the dialog that wants a fixed size
such as 300x200, implement View.onMeasure() to call
setMeasuredDimension(300, 200). Then when the view hierarchy layout
happens, the dialog window will be given a size that ensures your view
is that dimension (probably making the actual window larger to take
into account the dialog frame and decoration).
On Jan 15, 11:35 am, wrightjmf <wrig...@gmail.com> wrote:
Can anyone tell me how to change the size and location of a dialog
box? I have created an activity with its theme attribute set to
"@android:style/Theme.Dialog", but I can't figure out how to change
the size and location of the resulting dialog.