Android Question Map size

Dominik Böhm

Member
Licensed User
Longtime User
hi,

i had an bug in my code where i accidentally changed the key in an map from string to int.
after the put with the int key the map grows but the gui in the ide dont shows the new keys.

B4X:
    Dim mTest As Map
    Dim sIdx As String
    mTest.Initialize
    
    For idx=0 To 5
        Dim m1 As Map
        m1.Initialize
        sIdx=idx
        mTest.Put(sIdx, m1)
    Next
    Log(mTest.Size)
    Dim m2 As Map
    idx=2
    sIdx=idx
    m2 = mTest.Get(sIdx)
    mTest.Put(idx, m2)
    
    Log(mTest.Size)

 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…