title: How can I get a width/height of Dialog with FILL_PARENT layout?
body: <p>I have an activity with </p>
  
  <pre><code>android:theme="@android:style/Theme.Dialog" 
  </code></pre>
  
  <p>to show it as float window. Also I have a line </p>
  
  <pre><code>getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
  </code></pre>
  
  <p>And I need a width/height of this window to show content correctly. </p>
  
  <p>I've tested four options and did not get an answer:</p>
  
  <pre><code>//1 
  int width = getWindowManager().getDefaultDisplay().getWidth();
  
  //2 
  int width = getWindow().getDecorView().getWidth();
  
  //3 
  getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
  
  //4 
  int width = getWindow().getAttributes().width;
  </code></pre>
  
  <p>Thanks!</p>