I want to find the view\'s position on the display screen.
To do it, I use the methods such as view.getLeft()
,view.getBottom()
, vi
the methods u have written is enough to find the location on screen, but the place where you have written is not correct.
try to write the methods (view.getLeft(), view.getTop()... etc) in onWindowFocusChanged(boolean hasFocus) method.
for example...
**
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
System.out.println("Right:"+tv2.getRight());
System.out.println("Left:"+tv2.getLeft());
System.out.println("Top:"+tv2.getTop());
}
}
**
it will solve your issue.