How to copy file to sdcard with listview

islandman

Member
Licensed User
Longtime User
I use filedialog to copy file from sdcard, but i would like if it's possible from listview...
Well newbie rules, sorry...:sign0013:
 

Mahares

Expert
Licensed User
Longtime User
Suppose you have a listview: MyLv. You can copy it to a list and in turn copy the list to a text file:

B4X:
Dim MyLv as listview
Dim MyList As List
MyList.Initialize                  
         For i=0 To MyLv.Size-1
            MyList.Add(MyLv.GetItem(i))
         Next
         Dim MyTextWriter As TextWriter
         MyTextWriter.Initialize(File.OpenOutput(File.DirRootExternal,"mylvtext",False))
         MyTextWriter.WriteList(MyList)   'writes the above created List To the text File AND automatically line feeds after each List item
         MyTextWriter.close      'closes the writer
         MyList.Clear
 
Upvote 0
Top