画面に触れたときに処理する方法は次のとおりです。
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
画面からmyfingerを離すまで、2番目のログを表示したくありません。
私が間違っているのは何ですか?
ありがとう。