title: How to get the position of a Layout relative to screen
body: <p>I want to animate a relative layout along the y-axis so I want to get its position on the y-axis. 
  I tried many things like:</p>
  
  <pre><code>getY()
  getTop()
  getScreenLocation()
  </code></pre>
  
  <p>and so on, but everything is returning 0.</p>
  
  <p>How can I find the position?</p>
  
  <p>following is the code</p>
  
  <pre><code>ImageView advancetab = (ImageView) findViewById(R.id.imageView4);
  RelativeLayout advancelayout = (RelativeLayout) findViewById(R.id.relativeLayout2);
  final ObjectAnimator anim = ObjectAnimator.ofFloat(advancelayout, "Y", 
              advancelayout.getY(),advancelayout.getY()-100);
      anim.setDuration(1000);     
  advancetab.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
              anim.start();
          }
      });
  </code></pre>
  
  <p>When i clicked on the image then layout animate from 0,0 position to up.</p>