📜  长按手势 android - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:09.659000             🧑  作者: Mango

代码示例1
final GestureDetector gestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {
    public void onLongPress(MotionEvent e) {
        Log.e("", "Longpress detected");
    }
});

public boolean onTouchEvent(MotionEvent event) {
    return gestureDetector.onTouchEvent(event);
};