I'm not able to append a string to existing file using OutputStreamWriter
.
It rewrites the file and old data no longer exists:
try {
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(openFileOutput("filename", Context.MODE_PRIVATE));
outputStreamWriter.append(message);
outputStreamWriter.close();
}
"filename"
is a file that already exists. message
is a string to append.