Android Question Insert Map to List

Discussion in 'Android Questions' started by BarryW, Mar 3, 2015.

  1. BarryW

    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?

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

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

    eurojam Well-Known Member Licensed User

    may be there are other solutions which are smarter then this:
    Code:
    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)
     
    DonManfred likes this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    What exactly are you trying to add?

    If you want to add all the values then you should use @eurojam code. However you can just add the Map object to the list:
    Code:
    list1.Add(map1)
     
    DonManfred likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice