title: Android: get width of Layout programatically having fill_parent in its xml
body: <p>I have the a <code>LinearLayout</code> with width set in xml as <code>fill_parent</code> , now i need its width at runtime programatically. So i did this:</p>
  
  <pre><code>    LinearLayout layoutGet=(LinearLayout) findViewById(R.id.GameField1);
      LayoutParams layParamsGet= layoutGet.getLayoutParams();
      int width=layParamsGet.width;
  </code></pre>
  
  <p>But <code>width</code> value on debugging was found to be <code>-1</code>, anybody with idea why can't i get the exact width at runtime for LinearLayout with fill_parent set in layout xml.</p>