While extending OSMdroid Overlay
class in an application
import org.osmdroid.views.overlay.Overlay;
...
public class MapOverlayArea extends Overlay implements TextToSpeech.OnInitListener, OnTouchListener {
...
I receive an error:
error: no suitable constructor found for Overlay(no arguments) constructor Overlay.Overlay(Context) is not applicable
As indicated by the error message, the required constructor was missing.
public class MapOverlayArea extends Overlay implements TextToSpeech.OnInitListener, OnTouchListener {
public MapOverlayArea(Context ctx) {
super(ctx);
}
//....
}
Including the constructor as above, and calling it correctly from main activity using
MapOverlayArea mapOverlayArea = new MapOverlayArea(context);
solves the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With