How notify current layer for position change

I’m currently using osmdroid to display current positioning.

Based on the following example i tried to optimize the system a little bit by not constructing the ItemizedOverlay<OverlayItem> and ArrayList<OverlayItem> each time my location is changed, but construct them only once in the constructor, and later on simply add points to my ArrayList variable.

Here’s how it looks now:

private void InitializeMarkersOverlay() {
    mOverlayItemArrayList = new ArrayList<OverlayItem>();
    ItemizedOverlay<OverlayItem> locationOverlay =
            new ItemizedIconOverlay<OverlayItem>(this, mOverlayItemArrayList, null);


and when a new location arrives:

private void AddPointToOverlay(GeoPoint gPt, boolean bShouldClearList) {

    OverlayItem overlayItem = new OverlayItem("", "", gPt);
    Drawable markerDrawable = ContextCompat.getDrawable(this,;

    // first time initializer
    if(bShouldClearList) {

Since my mMapView already has a pointer to mOverlayItemArrayList i was hoping that my mapview’s layer would be automatically notified regarding the change. but nothing actually happens. Only by recreating the objects, i get to see the pin.

I got it working by accessing the overlay directly from the mapview object, not sure why exactly, as i was hoping mMapView.getOverlays() would hold a reference to the ItemizedIconOverlay and its itimized array

if(mMapView.getOverlays().size() > 0) {