title: android .getTop() returns 0.0
body: <p>I am developing an android lock screen app. I got the idea from another thread to check the coordinates of where the finger has pressed down against to the coordinates of the imagebutton that I have set up.</p>
  
  <p>I am trying to get the coordinates of the imagebutton using the <code>.getTop()</code> and <code>.getLeft()</code> but both are returning 0.0 (as they are floats, not int).</p>
  
  <p>why is this? I am new to android development, so sorry if I am missing something obvious.</p>
  
  <p>Also, I read somewhere that the <code>.getTop()</code> won't work after the <code>setContentView(R.layout.layoutname)</code> but if I put it above <code>setContentView(...)</code> then the app crashes.</p>
  
  <p>Is there another way to get the coordinates of the imagebutton, or would it be better/easier to get the coordinates and bounds of the table cell ? How would I do that?</p>
  
  <p>Thanks in advance :)</p>