kar*_*e23 0 java android touch-event
当我触摸屏幕时,我有以下方法来处理:
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;
}
Run Code Online (Sandbox Code Playgroud)
当我触摸屏幕而不移开手指时Logcat的结果是:
touching the screen: YES
touching the screen: NO
Run Code Online (Sandbox Code Playgroud)
直到我从屏幕上释放myfinger,我才想要显示第二个日志.
我做错了什么?
谢谢.
| 归档时间: |
|
| 查看次数: |
790 次 |
| 最近记录: |