title: Why does my FrameLayout have 0 height?
body: <p>I have a FrameLayout, containing various overlayed ImageViews:</p>
  
  <pre><code>&lt;FrameLayout
      android:id="@+id/australia_frame"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;ImageView
          android:id="@+id/australia"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:src="@drawable/map_australia"
          /&gt;
      &lt;ImageView
          android:id="@+id/nsw"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:src="@drawable/map_nsw"
          android:visibility="invisible"
          /&gt;
      &lt;ImageView
          android:id="@+id/victoria"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:src="@drawable/map_victoria"
          android:visibility="invisible"
          /&gt;
          ...etc...
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>In my code I try and render my FrameLayout:</p>
  
  <pre><code>final Dialog dialog = new Dialog((Context) parent);
  dialog.setContentView(R.layout.dialog_region);
  
  FrameLayout fl = (FrameLayout) dialog.findViewById(R.id.australia_frame);
  final int height = fl.getHeight();
  Validate.isTrue(height &gt; 0);
  </code></pre>
  
  <p>My code crashes with:</p>
  
  <pre><code>java.lang.IllegalArgumentException: The validated expression is false
      at org.apache.commons.lang3.Validate.isTrue(Validate.java:180)
  </code></pre>
  
  <p>The line that's crashing is <code>Validate.isTrue(height &gt; 0);</code>.</p>
  
  <p>Why does my FrameLayout not have a height? Is there a way to get the exact px height and width that my FrameLayout is rendering at?</p>