Variables Change to Undefined onResume


#1

Hello,

I am working on an application that uses the Mapbox API to display a map with various markers on specific locations. When a marker is tapped, the application displays various location details via an XML layout by retrieving that information from a database.

The issue I am having is that when the application resumes after a pause, the information within the XML layout changes to “undefined”. A portion of code within the XML file looks similar to the following:

  <Label row="0" col="0" tap="{{ onLocationTap }}" text="{{ selected_marker.location + ' - ' + selected_marker.city + ', ' + selected_marker.state + ' ' + selected_marker.postalcode }}" class="marker_city_state" textWrap="true" />

<Label text=" {{ selected_marker.moreInformation ? selected_marker.moreInformation : 'N/A' }}" class="h2 font-bold text-green" verticalAlignment="top" row="1" col="1" />

Another interesting thing to note is that the markers via the mapbox API do continue to change whenever a new marker is tapped. The issue is strictly with the variables within the XML portion, I believe.