I have an app that needs to read and write to a text file. I have it reading, but I don\'t have it writing. The idea is that when I click the save button on the screen, its
You can use FileOutputStream instead of OutputStreamWriter, something like this:
File file = getFileStreamPath("test.txt");
if (!file.exists()) {
file.createNewFile();
}
FileOutputStream writer = openFileOutput(file.getName(), Context.MODE_PRIVATE);
for (String string: data){
writer.write(string.getBytes());
writer.flush();
}
writer.close();
Check the android docs.