hi all,
I have a mapview on my application,
and now I want to get the longtitude/latitude when user
click on mapview,
there are two ways to detect click on mapview,
that's onTouchEvent and dispatchTouchEvent,
however onTouchEvent will not be work,
and dispatchTouchEvent work but still have two problems,
one is when user click mapview, the dispatchTouchEvent will
be trigger two times, the second is if I have a imageButton on
mapview, then click the imageButton will also trigger
dispatchTouchEvent
instead of ImageButton.onClick event?
so can somebody give me suggestion?
thanks
============================================
public boolean dispatchTouchEvent(MotionEvent ev) {
// TODO Auto-generated method stub
//test
Projection p=mMapView01.getProjection();
GeoPoint g=p.fromPixels((int)ev.getX(), (int)ev.getY());
double d1=g.getLatitudeE6()/1E6;
double d2=g.getLongitudeE6()/1E6;
showDialog("lat:"+d1+"lon:"+d2);
return super.dispatchTouchEvent(ev);
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en