title: getLayoutParams returning null?
body: <p>I've created a class that extends a View:</p>
  
  <pre><code>public class BoardView extends View  {
  </code></pre>
  
  <p>and I've specified the width and height of the BoardView in the application's main.xml file:</p>
  
  <pre><code>  &lt;mypackage.BoardView
          android:id="@+id/board"         
          android:layout_width="270px" 
          android:layout_height="270px" /&gt; 
  </code></pre>
  
  <p>I'm trying to get the width and height from a function that is called from the BoardView's constructor. Here's what I'm doing:</p>
  
  <pre><code>ViewGroup.LayoutParams p = this.getLayoutParams();
  int h = p.height;
  </code></pre>
  
  <p>but getLayoutParams is always returning null.  Any idea why this isn't working?</p>