title: Get width and height of ViewPager
body: <p>I have a <code>viewpager</code> in my layout:</p>
  
  <p></p>
  
  <pre><code>&lt;ListView
          android:id="@+id/list"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_weight="0"&gt;&lt;/ListView&gt;
  
  &lt;CustomViewPager
          android:id="@+id/pager"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>Now I want to get the actually width and height of the <code>ViewPager</code>:</p>
  
  <pre><code>public class CustomViewPager extends ViewPager {
      public MyBookView(Context context, AttributeSet attrs) {
          super(context, attrs);
          Log.d("pager","width:" + getWidth() + "mwidth:" + getMeasuredWidth());
      }
  }
  </code></pre>
  
  <p>While the <code>width</code> and <code>mwidth</code> is always <code>0</code>.</p>
  
  <p>What's the problem?</p>