Android Question KeyValueStore, where is my bug ?

marcick

Well-Known Member
Licensed User
Longtime User
I'm trying to store and retrieve a list of LatLng using KeyValueStore.
Why the logged value in this code are null ?

B4X:
GeoFenceKvs.Initialize(AppPath, "G1.kvs")
    Dim l1,l2,l3 As LatLng
    l1.Initialize(45,8)
    l2.Initialize(46,9)
    l3.Initialize(47,10)
    Dim p As List
    p.Initialize
    p.Add(l1)
    p.Add(l2)
    p.Add(l3)
    GeoFenceKvs.PutObject("1111",p)
   
    Dim p2 As List=GeoFenceKvs.GetObject("1111")
    Log(p2.Get(0))
    Log(p2.Get(1))
    Log(p2.Get(2))
 

tufanv

Expert
Licensed User
Longtime User
I'm trying to store and retrieve a list of LatLng using KeyValueStore.
Why the logged value in this code are null ?

B4X:
GeoFenceKvs.Initialize(AppPath, "G1.kvs")
    Dim l1,l2,l3 As LatLng
    l1.Initialize(45,8)
    l2.Initialize(46,9)
    l3.Initialize(47,10)
    Dim p As List
    p.Initialize
    p.Add(l1)
    p.Add(l2)
    p.Add(l3)
    GeoFenceKvs.PutObject("1111",p)
  
    Dim p2 As List=GeoFenceKvs.GetObject("1111")
    Log(p2.Get(0))
    Log(p2.Get(1))
    Log(p2.Get(2))


check : https://www.b4x.com/android/forum/threads/keystorevalue-problem-with-latlng.59544/#post-375411
 
Upvote 0
Top