javascript - Android How to detect double tap? -
i'm trying refresh canvas
on doubletap
in android. use gesturedetector
in custom view
.
final gesturedetector mdetector = new gesturedetector( getcontext(), new gesturedetector.ongesturelistener() { @override public boolean ondoubletap(motionevent e) { invalidate(); return true; } }
but i'm getting error
the method ondoubletap(motionevent) of type new gesturedetector.ongesturelistener(){} must override or implement supertype method
with
remove '@override' annotation
solution. remove override , warning
the method ondoubletap(motionevent) type new gesturedetector.ongesturelistener() {} never used locally.
then tried test whether works , made function change textview
string whenever doubletap
. nothing happens.
i looked @ gesturedetector reference explanations, don't have doubletap
there, uses. should do?
try this
final gesturedetector mdetector = new gesturedetector(getcontext(), new gesturedetector.simpleongesturelistener { @override public boolean ondown(motionevent e) { return true; } @override public boolean ondoubletap(motionevent e) { return true; } });
Comments
Post a Comment