GestureDetector Deprecated Issue

AndreaF picture AndreaF · Oct 13, 2012 · Viewed 20.4k times · Source

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?

Answer

CommonsWare picture CommonsWare · Oct 13, 2012

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.