Android Question ListView_ItemLongClick on ScrollView

GMan

Well-Known Member
Licensed User
Longtime User
I am using this code, but the _ItemClick or _ItemLongClick raises no event ?
B4X:
Sub listlocal_Click
    Activity.RemoveAllViews
    Activity.LoadLayout ("listlocal")
   
    Dim lblFiles As Label
    lblFiles.Initialize("")

   
    Dim lvListe As ListView
    lvListe.Initialize("")
    'Activity.AddView(lblFiles, 10%x, 10%y, 80%x, 80%y)
   
    Dim lst0 As List
    lst0 = File.ListFiles(File.DirAssets)
    'lst0 = File.ListFiles("/mnt/sdcard2/Download/OGGs/")
 
    For i = 0 To lst0.Size - 1
        lblFiles.Text = lblFiles.Text & CRLF & lst0.Get(i)
        ScrollViewListe.Panel.Color = Colors.DarkGray
        lvListe.AddSingleLine2 (lst0.Get(i),lst0.Get(i))
    Next
    ScrollViewListe.SetLayout(0,0,100%x,2000%y)
    ScrollViewListe.Panel.AddView(lvListe,0,0,100%x,100%y)   
    lvListe.BringToFront
End Sub
Sub lvListe_ItemClick(Position As Int, Value As Object)
    Dim wahllist As List
    wahllist.Initialize
    wahllist.AddAll(Array As String( "Text1","Text2","Testertext3"))
    InputList(wahllist,"Title As String",1)
    ToastMessageShow(Position & " " & Value,False)
End Sub
 

GMan

Well-Known Member
Licensed User
Longtime User
lvListe.Initialize("")

should be:

lvListe.Initialize("lvListe")
Thx, that's it :confused:

@klaus
i did it this way 'cause i couldnt work out how to add a list to a scrollview :oops:
 
Upvote 0
Top