Community

Topic: Xamarin component

Error when clicking on GeoMarker after updating the GeoElements

Julien
Thursday, February 1, 2018

Hi,
I’m trying to display or hide my GeoMarkers in my Xamarin Android Project depending on their distances with the user.
I’m using the SetGeoElements function in OnGeolocationChanged to update the markers with the ones that are within a set distance of the user by passing a List with a varying number of Geolements.
I am however getting a Java.Lang.NullPointerException (Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference) from time to time when I try to click on a Geolement that has been deleted and then added again via the SetGeoElements function.
The Geoelements that are being added and deleted are fixed (they have the same string ID).
Thanks in advance for the help.

user profile image
Support Team  (expert)
Monday, February 5, 2018

Hi,
the SetGeoElements method does not automatically redraw the markers, this is done only in certain special cases.
You can force the markers redrawing by calling the RefreshActivityGeoElements method right after the SetGeoElements method.
Best regards,

Sign in to add a comment