GestureDetector Deprecated Issue GestureDetector Deprecated Issue android android

GestureDetector Deprecated Issue


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.


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


1 try add Context to your method: `

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

2 if you already have call to class Context in your method try:

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