Issue
I'm trying to fix a current Location on my MapView in Android, but still want to handle the onTouch Event.
Background: I've some buttons beside my mapView. If i chosoe "move", the normal behaviour of the mapView is required.
If i choose another button, the current map should be locked, so i can draw something on the map. Therefore i need the onTouch-Event of the map...
my only solution to fix the mapView is to setClickable to false... but when i do this, the onTouch Event will no longer be supported...
How can i make it happen?
Sorry for my bad englisch,
daniel
Solution
To avoid having MapView
processing motion events, don´t call super.dispatchTouchEvent()
and return true;
Example code:
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if(drawMode){
//do my drawing here
return true;
} else retrun super.dispatchTouchEvent(ev);
}
Regards.
Answered By - Luis
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.