I am trying to apply the tutorial here https://www.b4x.com/android/forum/threads/listview-tutorial.6537/ but I would like to instanciate the ListView in an existing layout.
Obviously the listview exists, as I can see it's row when I tap where I know it is.
Apparently, I should attach the view to Main, and not the activity, but I don't know how to proceed. Is it possible, and if so, how do I do that ?
TIA
Obviously the listview exists, as I can see it's row when I tap where I know it is.
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("Main")
ListView1.Initialize("ListView1")
For i = 1 To 300
ListView1.AddSingleLine("Item #" & i)
Next
Activity.AddView(ListView1, 0, 0, 100dip, 500dip)
ListView1.Visible = True
ListView1.BringToFront
End Sub
Apparently, I should attach the view to Main, and not the activity, but I don't know how to proceed. Is it possible, and if so, how do I do that ?
TIA