Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GestureDetector Deprecated Issue

I have this code

itemizedOverlay = new MyItemizedOverlay(drawable,this);
itemizedOverlay.setGestureDetector(new GestureDetector(new MyGestureDetecor()));

but new GestureDetector is marked as Deprecated in Eclipse.

I want to avoid the use of deprecated methods.

How could I fix this problem?

What is the non-deprecated form?

like image 883
AndreaF Avatar asked Oct 13 '12 13:10

AndreaF


2 Answers

Choose one of the other constructors. There are five defined constructors on GestureDetector. Two -- the ones not including a Context as the first parameter -- are marked as deprecated. You are using one of those.

like image 159
CommonsWare Avatar answered Oct 23 '22 20:10

CommonsWare


There are just two deprecated constructors. If you add the context to GestureDetector(context, listener) it's not deprecated.

like image 21
Olaf Dietsche Avatar answered Oct 23 '22 19:10

Olaf Dietsche