当我触摸屏幕时,我有以下处理方法:
public boolean onTouchEvent(MotionEvent event) {
boolean touchDown = true;
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
Log.i(TAG,"touching the screen: YES");
case MotionEvent.ACTION_UP:
touchDown = false;
Log.i(TAG,"touching the screen: NO");
}
return touchDown;
}
当我在不移开手指的情况下触摸屏幕时,Logcat 的结果是:
touching the screen: YES
touching the screen: NO
在我从屏幕上松开手指之前,我不想显示第二个日志。
我做错了什么?
谢谢。