but later when i try to get the values with keystorevalue
B4X:
dim listgetir as list
listgetir.Initialize
listgetir=kvs.GetObject("example")
i see that all the values of list are null so i cant add as polyline to my googlemap objects. Eurojam tried to help and said that it is because of the latlng type , when he stored the values as double he could list them. But to add to googlemap i still need them as latlng. How can i fix this ?
You will need to create your own custom type instead of LatLng.
B4X:
Type MyLatLng (Latitude As Double, Longitude As Double)
B4X:
Sub LatLngToMyLatLng (ll As LatLng) As MyLatLng
dim mll As MyLatLng
mll.Initialize
mll.Latitude = ll.Latitude
mll.Longitude = ll.Longitude
Return ml
End Sub
Erel I tried it now i can see in the logs the correct values instead of nulls but this time when i try to add them as polyline i get:
java.lang.ClassCastException: fv.speedometer.main$_mylatlng cannot be cast to com.google.android.gms.maps.model.LatLng
You will need to create your own custom type instead of LatLng.
B4X:
Type MyLatLng (Latitude As Double, Longitude As Double)
B4X:
Sub LatLngToMyLatLng (ll As LatLng) As MyLatLng
dim mll As MyLatLng
mll.Initialize
mll.Latitude = ll.Latitude
mll.Longitude = ll.Longitude
Return ml
End Sub