Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/193.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何停止在谷歌地图上滚动?_Android_Google Maps - Fatal编程技术网

Android 如何停止在谷歌地图上滚动?

Android 如何停止在谷歌地图上滚动?,android,google-maps,Android,Google Maps,我在android中编写了停止在地图上滚动的代码。但在MotionEvent.ACTION\u出现时叠加添加。我怎么修理它?或者我如何停止地图滚动 @Override public boolean onTouch(View arg0, MotionEvent arg1) { if(arg1.getAction() == MotionEvent.ACTION_MOVE){ Drawable drawable = context.getResource

我在android中编写了停止在地图上滚动的代码。但在MotionEvent.ACTION\u出现时叠加添加。我怎么修理它?或者我如何停止地图滚动

 @Override
public boolean onTouch(View arg0, MotionEvent arg1) {

  if(arg1.getAction() == MotionEvent.ACTION_MOVE){
                    Drawable drawable = context.getResources().getDrawable(R.drawable.icon16);

                    // create and add an OverlayItem to the MyItemizedOverlay list
                    OverlayItem overlayItem = new OverlayItem(gPt, "", "");

                    itemizedOverlay = new MyItemizedOverlay(drawable,context);
                    itemizedOverlay.addOverlay(overlayItem);

                    // add the overlays to the map
                    mMapVw.getOverlays().clear();
                    mMapVw.getOverlays().add(itemizedOverlay);


                  return true;



            }
        }


        return false;
}

调用
setClickable(假)应禁用地图视图的所有触摸事件

但在那个时候没有移动发生,例如,我不能移动地图上的覆盖