I am trying to write data to a file each time getView() is called in a adapter. I append to the file every time the call is made with a string value (the row data of the listview).
I do not open the file every single time because the performance is affected severely if I do so. Hence, I keep the stream open and only append and write new line every time getView() is called.
When I open the file later after my operations are complete, I see each row duplicated in my file at least 5-6 times! The file is much larger than it should be. I see the correct values on my ListView though.
I perform appends in a new thread within the getView() method (I do not use a AsyncTask. I just say new Thread() { run() {//My operation}}.start().
I am using Android 4.0. I think the issue with getView() getting called more than once for every row has been fixed. Or has it?
Any ideas??