I have not found a real way to do this. Here is the method I used:
After creating the ImageView, highlight the known location.
int ivX = 0; int ivY = 0; _iv.invalidate(); _iv.scrollTo(ivX, ivY);
So I have the exact (x, y) coordinates where I am. Then I applied the onScroll () method and used the generated distances to recalculate the coordinates (x, y):
@Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
In addition, to better understand how scrollTo() works, and the relationship between the coordinates of the image and its container, follow this link in another post of mine.
source share