title: How to set DialogFragment's width and height?
body: <p>Let's say I specify the layout of my <code>DialogFragment</code> in an xml layout file named <code>my_dialog_fragment.xml</code> and I specify the <code>layout_width</code> and <code>layout_height</code> values of its root view to a fixed value (e.g. <code>100dp</code>). I then inflate this layout in my <code>DialogFragment</code>'s <code>onCreateView(...)</code> method as follows:</p>
  <pre><code>View view = inflater.inflate(R.layout.my_dialog_fragment, container, false);
  </code></pre>
  <p>Sadly, I find that when my <code>DialogFragment</code> appears, it does not respect the <code>layout_width</code> and <code>layout_height</code> values specified in its xml layout file and instead shrinks or expands depending on its content. Anyone know whether or how I can get my <code>DialogFragment</code> to respect the <code>layout_width</code> and <code>layout_height</code> values specified in its xml layout file? At the moment I'm having to specify the width and height of the <code>Dialog</code> again in my <code>DialogFragment</code>'s <code>onResume()</code> method as follows:</p>
  <pre><code>getDialog().getWindow().setLayout(width, height);
  </code></pre>
  <p>The problem with this is that I have to remember to make any future changes to the width and height in two places.</p>