title: How to get programmatically width and height of Relative - Linear layout in android?
body: <p>I required runtime dimensions of Relative/Linear Layout. </p>
  
  <p><strong>activity_home.xml</strong>:</p>
  
  <pre><code>&lt;RelativeLayout
      android:id="@+id/rlParent"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>HomeActivity.java:</p>
  
  <pre><code>private int width, height;
  
  RelativeLayout rlParent = (RelativeLayout) findViewById(R.id.rlParent);
  
  w = rlParent.getWidth();
  h = rlParent.getHeight();
  
  Log.i("Width-Height", width+"-"+height);
  </code></pre>
  
  <p>Please share your thoughts.</p>