AnsweredAssumed Answered

Unable to cast LocationDataSource.Location to NmeaDataSource.Location

Question asked by adick@blm.gov_BLM_EGIS on Aug 7, 2020
Latest reply on Aug 21, 2020 by adick@blm.gov_BLM_EGIS

When I try to cast LocationDataSource.Location to NmeaDataSource.Location I get the following error...

 

java.lang.ClassCastException: com.esri.arcgisruntime.location.LocationDataSource$Location cannot be cast to com.esri.arcgisruntime.location.NmeaDataSource$Location

 

I am wondering why this does not work?  I am using 100.8 and the documentation seems to indicate casting should be possible...

NmeaDataSource.Location (ArcGIS Runtime SDK for Android 100.8.0) 

It states the following there...

---------------------------------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Below is the code that I am using

 

lListener = new LocationDisplay.LocationChangedListener() {
   @Override
   public void onLocationChanged(LocationDisplay.LocationChangedEvent locationChangedEvent) {
      try {
          NmeaDataSource.Location mLocation = (NmeaDataSource.Location) locationChangedEvent.getSource().getLocation();

Outcomes