0

This may not be the smartest question but I'm kind of a beginner and I'm having trouble figuring out what the "this" in the following methods refers to. Could anyone help me with it?

public class MapViewExt extends MapView {

    public MapViewExt(Context context) {
        super(context);
    }

    public void addMarker(MapMarker marker) {
        MarkerApiKt.addMarker(this, marker, marker.getX(), marker.getY(), -0.5f, -0.5f, 0f, 0f);
    }

    public void removeMarker(MapMarker mapMarker){
        MarkerApiKt.removeMarker(this, mapMarker);
    }

    public void setMarkerTapListener(MarkerTapListener markerTapListener){
        MarkerApiKt.setMarkerTapListener(this,markerTapListener);
    }
}

jean
  • 1
  • 3
    `this` refers to the `MapViewExt` instance in your example. However, if you're a beginner (with Java at least) I'd recommend getting a grasp of the basics first before diving into Android development. – Thomas May 12 '21 at 10:32
  • *"This may not be the smartest question but I'm kind of a beginner ... "* - The smarter thing for a beginner to >>do<< is to find a good tutorial (or a textbook, or a training course). Structured learning is a better than learning by asking questions. – Stephen C May 12 '21 at 10:46

0 Answers0