Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GestureDetector and GestureDetectorCompat

What is the difference between GestureDetector Class and the GestureDetectorCompat class? Both to do the same thing(deal with gestures) but which one should I use?

like image 928
user3558118 Avatar asked Oct 17 '14 13:10

user3558118


People also ask

How do you use GestureDetector?

Detect gestures. Android provides the GestureDetector class for detecting common gestures. Some of the gestures it supports include onDown() , onLongPress() , onFling() , and so on. You can use GestureDetector in conjunction with the onTouchEvent() method described above.


1 Answers

GestureDetectorCompat enables your to use all of the GestureDetector capability on old android version. That's all.

So you probably want to use the compat version which has identical APIs.

like image 61
Stephane Mathis Avatar answered Sep 25 '22 00:09

Stephane Mathis