Android Question Get second line listview value

Discussion in 'Android Questions' started by select, Jun 12, 2015.

  1. select

    select Member Licensed User

    Hello! There is a way to get the value of the second line of a clicked item in a listview?

    For the first line is simple, like:

    Sub ListView1_ItemClick (Position As Int, Value As Object)
    MyVal = Value
    End Sub
    How can I do this for the second line?

  2. DonManfred

    DonManfred Expert Licensed User

    Store all informations in one object. For example a map

    Dim retmap As Map
    "line1","Line 1")
    "line2","Line 2")
    "line1"),retmap.Get("line2"), retmap)
    End Sub
    Sub lv_ItemClick (Position As Int, Value As Object)
    Dim retmap As Map = Value
    Log("Item at Pos "&Position&" Clicked...")
    Log("tag = "&retmap.Get("tag"))
    Log("itemID = "&retmap.Get("itemID"))
    Log("name = "&retmap.Get("name"))
    Log("line 1 = "&retmap.Get("line1"))
    Log("line 2 = "&retmap.Get("line2"))
    End Sub
    giga and lemonisdead like this.
  3. Mahares

    Mahares Well-Known Member Licensed User

    Why can't he use something simple like this or did I totally misunderstand his question? But again, who am I to argue with the powerhouse Manfred.

    Sub Listview1_ItemClick (Position As Int, Value As Object)
    Dim MyVal As String = Value
    Log(MyVal)  'displays: line2text
    End Sub
    mangojack likes this.
  4. DonManfred

    DonManfred Expert Licensed User

    Sure you can just use a string
    But i find it more confortable to store more info