Android Question Insert Map to List

BarryW

Active Member
Licensed User
Hi masters is there any way how to insert a set of map into a list as object

B4a accepts list to map but how do it vice versa?

B4X:
Dim list1 as List
Dim map1 as map = list1
To

B4X:
Dim map1 as Map
Dim list1 as List
List1.AddAll(m)
is it possible? Tnx!!!
 

eurojam

Well-Known Member
Licensed User
may be there are other solutions which are smarter then this:
B4X:
Dim map1 As Map
Dim list1 As List
Dim mypanel As Panel
mypanel.Initialize("P")
list1.Initialize
map1.Initialize
map1.Put(1,"Hello World")
map1.put(2,mypanel)
list1.Add(0)
For Each v As Object In  map1.Values
   Log(v)
   list1.Add(v)
Next
Log(list1.Size)
 
Top