I recently started to use OSMDroid, but I struggle to get a default marker at a specific Geopoint on Android API 28. I followed the tutorial from the OSMDroid's Github and wrote a code like this:
//Making a Mapbox TileSource
MapBoxTileSource mbTest = new MapBoxTileSource("mapbox.streets", ACCESS_TOKEN);
map = (MapView) findViewById(R.id.map);
map.setTileSource(mbTest);
//Setting up map
map.setVisibility(View.VISIBLE);
map.setMultiTouchControls(true);
map.getController().setCenter(new GeoPoint(latitude,longitude));
map.getController().setZoom(14d);
//Create a marker where the user is
Marker positionMarker = new Marker(map);
positionMarker.setDefaultIcon();
positionMarker.setPosition(new GeoPoint(latitude, longitude));
map.getOverlays().add(positionMarker);
And I have the following result when i test my app (i draw a polygon using OSMDroid and it seems to work fine):
I tested the same app on an Android API 22 device and the marker worked fine, being and staying at the right location while scaling with the zoom level.
Is there any way to fix or improve my code to make the marker work on API 28 ?