title: Android - get Height of the parent layout
body: <p>I want to determine the available height and width of the parent layout to which I have to add my view. </p>
  
  <p>I have used many methods on layout like</p>
  
  <ul>
  <li>layout.getHeight()</li>
  <li>layout.getRootView().getHeight()</li>
  </ul>
  
  <p>All these methods return 0(zero) as the result.</p>
  
  <p>My main requirement is to be able to give width to a view that is some % of the width of the layout . </p>
  
  <p>Also I dont want to use tag for this. I want to do it through code.</p>
  
  <p>Thanks in advance.</p>