title: Finding the View location (position) on display (screen) in android
body: <p>I want to find the view's position on the display screen. </p>
  
  <p>To do it, I use the methods such as <code>view.getLeft()</code> ,<code>view.getBottom()</code> , <code>view.getRight()</code> , <code>view.getTop()</code>. But unfortunately, all these methods are returned <code>0</code>.<br>
  Is there any alternate way to find the view's positions (i.e coordinates on screen)?</p>
  
  <p>My layout <code>main.xml</code>: </p>
  
  <pre><code>&lt;TextView android:id="@+id/tv1"
      android:layout_width="200px"
      android:layout_height="30px"
      android:text="welcome to" /&gt;
  
  &lt;TextView android:id="@+id/tv2"
      android:layout_width="200px"
      android:layout_height="30px"
      android:text=" Make Eit solution " /&gt;
  </code></pre>
  
  <p>And my class has this in <code>onCreate()</code>:</p>
  
  <pre><code>super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  
  tv1 = (TextView) findViewById(R.id.tv1);
  tv2 = (TextView) findViewById(R.id.tv2);
  
  System.out.println("tv4 width:"+tv2.getWidth());
  System.out.println("tv4 height:"+tv2.getHeight());
  System.out.println("Right:"+tv2.getRight());
  System.out.println("Left:"+tv2.getLeft());
  System.out.println("Top:"+tv2.getTop());
  System.out.println("Bottom:"+tv2.getBottom());
  </code></pre>