title: Canvas getWidth() and getHeight() in android-10 and android-23
body: <p>I'm writing android code where I draw a custom view on canvas (allocated some portion of the screen)</p>
  
  <p>For this I'm using <code>canvas.getWidth()</code> and <code>canvas.getHeight()</code>.</p>
  
  <p>In android versions above <code>ICS</code>, I'm able to see the view and it's working fine.</p>
  
  <p>But in <code>gingerbread</code> and <code>froyo</code>, it's not working.</p>
  
  <p>When I tried to debug, I found that <code>canvas.getWidth()</code> and <code>canvas.getHeight()</code> are giving wrong values (in fact they are returning screen dimensions) in <code>gingerbread</code> and <code>froyo</code>.</p>
  
  <p>Please help me.</p>