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?

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.


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()));


Need Your Help

jstl foreach omit an element in last record

jsp jstl

trying to use this jstl to formulate a json string, how can i make the segment not to put a comma in the end of the last record? note the comma in the end

Is there a command line C++ to PDF converter with syntax highlighting?

c++ pdf documentation syntax-highlighting

I need to supply "Source code documents w/ Line numbers" which is essentially just a PDF of the source code with syntax highlighting and Line numbers. Is there any existing command line tools for