나는 자바/안드로이드 멍청한 놈이야하지만 여기에 나를 위해 작동 코드입니다 :
class HelloOnTouchListener implements OnTouchListener {
public boolean onTouch(View v, MotionEvent e) {
handleTouchEvent(e);
return true;
}
}
public void handleTouchEvent(MotionEvent e) {
int eAct = e.getAction();
if (eAct == 0) Log.d("touch", "press");
else if (eAct == 1) Log.d("touch", "release");
}
는 그리고 여기 DOWN 후 두 번하지 (UP 불을 수행하는 코드 먼저 오른쪽의 다음 때 실제로 자료) :
public void handleTouchEvent(MotionEvent e) {
int eAct = e.getAction();
switch (eAct) {
case MotionEvent.ACTION_DOWN: Log.d("touch", "press");
case MotionEvent.ACTION_UP: Log.d("touch", "release");
}
}
아니라 대부분의 아마 오랫동안 누르면, 당신의 긴 클릭 밤은이 말을하고 있기 때문에, 어떠한 조치가 수행되지 않고 action_up 실행 longClick로 action_down 변경 ... longClick 리스너를 구현하려고합니다. .. 도움이 될거야. – Urban
당신이보고있는 것은 이것이라고 생각합니다 : http://stackoverflow.com/questions/4168687/ontouchlistener-action-up-fires-automatically-after-30-second-timeout하지만 유감스럽게도 해결 방법은 없습니다 ... –