Im using google maps in my application. im implementing onDoubleTap() method
for zoom in google map. i have written some code but nothing happened when i
double tap on google map. I have 2 questions.
1. Is it possible to check DoubleTap in emulator?
2. I am sharing my code here. Please if somebody knows the problem reply me.
here in this code onTouchEvent is never called. Any suggestion how to call
it ? Remember i am using Emulator not a real device.
public class MapExercise extends MapActivity implements OnGestureListener,
OnDoubleTapListener {
private GestureDetector detector;
MapView mapView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mapView = (MapView) findViewById(R.id.mapview);
detector = new GestureDetector(this,this);
mapView.setBuiltInZoomControls(true);
}
@Override
public boolean onTouchEvent(MotionEvent event){
//this.detector.onTouchEvent(event);
//return super.onTouchEvent(event);
return this.detector.onTouchEvent(event);
}
@Override
public boolean onDown(MotionEvent e) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
// TODO Auto-generated method stub
return false;
}
@Override
public void onLongPress(MotionEvent e) {
// TODO Auto-generated method stub
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
float distanceY) {
// TODO Auto-generated method stub
return false;
}
@Override
public void onShowPress(MotionEvent e) {
// TODO Auto-generated method stub
}
@Override
public boolean onSingleTapUp(MotionEvent e) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean onDoubleTap(MotionEvent e) {
// TODO Auto-generated method stub
//mapView.getController().zoomIn();
mapView.getController().setZoom(mapView.getZoomLevel() + 1);
return true;
}
@Override
public boolean onDoubleTapEvent(MotionEvent e) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
// TODO Auto-generated method stub
return false;
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
--
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