Android Question SOLVED Populate listview from txt file?

Discussion in 'Android Questions' started by G-ShadoW, Jun 28, 2015.

  1. G-ShadoW

    G-ShadoW Active Member Licensed User

    Hello,
    how to fill ListView ?

    Inside txt file:
    Code:
    MK Lion:15.07.2015:www.example.com
    MK Dog:
    18.07.2015:www.something.com
    etc...
    Code:
    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
     
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