Java 在Android中向视图添加双击侦听器
我正在尝试在TextView上添加双击侦听器。我知道我可能需要使用手势检测器,但我不确定你是如何做到的 试试这个Java 在Android中向视图添加双击侦听器,java,android,android-edittext,listener,Java,Android,Android Edittext,Listener,我正在尝试在TextView上添加双击侦听器。我知道我可能需要使用手势检测器,但我不确定你是如何做到的 试试这个 // Instantiate the gesture detector with the // application context and an implementation of // GestureDetector.OnGestureListener mDetector = new GestureDetectorCompat(t
// 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);
或者使用给定的链接
这在活动上添加了一个手势检测器。我正试图将其添加到文本视图中