我有一个小问题。基本上我想要做的是绘制航点到地图,触摸。但我想在添加一个航点后停止 onTouch 方法,因为现在它只需单击即可添加更多航点,然后继续添加它们下一步触及。
方法如下
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if(resultCode==RESULT_OK)
{
final MapPoint point=(MapPoint) data.getSerializableExtra("result");
GeoPoint point2 = new GeoPoint(51496994, -134254);
point.setGeo(point2);
view.setOnTouchListener(new View.OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent e) {
GeoPoint geo = null;
IProjection project = view.getProjection();
geo=(GeoPoint)project.fromPixels((int)e.getX(),(int)e.getY());
mainDrawer.addGeopointToMap(point.getName(), point.getDesc(), geo);
return false;
}});
}