Why are you using AsyncStreams to write to a file?
Just use the standard File methods.
Hi Erel
Thanks again to respond.
I used :
Public Sub gravar_dados
Dim Writer As TextWriter
Writer.Initialize (File.OpenOutput (File.DirInternal, "xxx.txt", False))
Writer.WriteLine ("some data")
Writer.Flush
Writer.Close
End Sub
and when I power down tablet, some time data was not written, some time written nonsense data
I know that my problem is to power down the tablet with no chance to Android real write to disk.
If I write data and press the power down button (shutdown or restart), Android write to disk and no problem, but press button all time is not desired.
I have very litle knowledge in C, and the sync command 'forces' the OS to real write data to disk, even though this use time to do.
So, I searched internet to 'Android and sync' and found the example using Java and Outputstream and worked. No special reason to use it.
Rubens Jr.