1
我試圖在MapView上實現onTouchEvent來更新地點,但是當我觸摸屏幕時只捕獲ACTION_UP,它會觸發3次。在這種情況下如何執行我的代碼?Android OnTouchEvent觸發3次
@Override
public boolean onTouchEvent(MotionEvent event, MapView mapView) {
int action = event.getAction();
if (action == MotionEvent.ACTION_UP) {
Log.e("Touch", Integer.toString(event.getAction()));
//All 3 fires has index 1 that concern to ACTION_UP
//Below will be AsyncTask call
}
return false;
}
謝謝,這可以幫助我! – user1376885