Answer the question
In order to leave comments, you need to log in
How to add a new line to the end of a file?
WriteToFile("studentsapp22.txt", rcet.getText().toString());
Answer the question
In order to leave comments, you need to log in
try {
PrintWriter prWr = new PrintWriter(new BufferedWriter(new FileWriter("somefile.txt", true)));
prWr .println("the text");
prWr .close();
} catch (IOException e) {
e.printStackTrace();
}
1) WriteToFile function does not exist in android java. Taken a separate script.
2) You can solve the problem like this: Read the entire file line by line + "\n", complete and write back.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question