Android Question SOLVED Populate listview from txt file?

G-ShadoW

Active Member
Licensed User
Longtime User
Hello,
how to fill ListView ?

Inside txt file:
B4X:
MK Lion:15.07.2015:www.example.com
MK Dog:18.07.2015:www.something.com
etc...

B4X:
Sub ReadTextFile
   
    Dim reader As TextReader       
    reader.Initialize(File.OpenInput(FilePath,FileName))
    Dim line As String
    line = reader.ReadLine
    Do While line <> Null
          MyList.add(line)
          line = reader.ReadLine
    Loop               
    reader.Close 
    For i=0 To MyList.Size-1
         Dim MyLine As String =MyList.Get(i)
        Listview1.AddTwoLines2(MyLine.SubString2(0,MyLine.IndexOf(":"),..... ' <------
       
    Next
   
End Sub
 
Top