Android Question File.WriteList line missing

potduang

Member
Licensed User
Longtime User
Hi,

Please anyone can explain about file.writelist. Suppose I have a list with 2 items as picture

upload_2014-6-20_23-8-28.png


Then I write it to a text file as

File.WriteList(File.DirDefaultExternal,"Barscan.txt",ListSend)

Why my output text file contain only the last item as picture?

20-6-2557 23-01-29.jpg


Thank you
Piyapong.
 

klaus

Expert
Licensed User
Longtime User
Strange !
What object is ListSend ?
Why do you have two Null values ?

This code works perfectly!
B4X:
Sub Globals
    Dim ListSend As List
    Dim ListSend1 As List
End Sub

Sub Activity_Create(FirstTime As Boolean)
    ListSend.Initialize
    ListSend.Add("8858767410646:S7615-12:3020")
    ListSend.Add("8858767410647:S7615-12:3000")
End Sub

Sub Activity_Resume
    File.WriteList(File.DirDefaultExternal,"Barscan.txt",ListSend)
    ListSend1 = File.ReadList(File.DirDefaultExternal,"Barscan.txt")
    Log(ListSend1.Get(0))
    Log(ListSend1.Get(1))
End Sub
 
Upvote 0

potduang

Member
Licensed User
Longtime User
Hi Klaus,

Yes, very strange. Perhaps from chr(13) & chr(10) at end of line ?????
I try check myself. Thank you for your code sample.

PP.
 
Upvote 0
Top