What do you want to use:
OnTouchListener touchListener = new OnTouchListener(){
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
Log.d(LOG_TAG, "Action is: " + action);
switch (action){
case MotionEvent.ACTION_DOWN:
timeAtDown = SystemClock.elapsedRealtime();
break;
case MotionEvent.ACTION_UP:
long durationOfTouch = SystemClock.elapsedRealtime() - timeAtDown;
Log.d(LOG_TAG, "Touch event lasted " + durationOfTouch + " milliseconds.");
break;
}
return false;
}
};
button.setOnTouchListener(touchListener);
timeAtDown - long, , touchListener. , ; , . . 'click' , DOWN ( MOVE) UP.