我正在尝试在 TextView
上添加双击监听器。我知道我可能必须使用 GestureDetector
,但我不太确定你是如何做到这一点的。
最佳答案
试试这个
// Instantiate the gesture detector with the
// application context and an implementation of
// GestureDetector.OnGestureListener
mDetector = new GestureDetectorCompat(this,this);
// Set the gesture detector as the double tap
// listener.
mDetector.setOnDoubleTapListener(this);
或使用给定的链接。
关于java - 将双击监听器添加到 Android 中的 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45384799/