I am saving a log to a .txt file on the sdcard but once there is two lines saved, it overwrites it and starts over?
Here is my code:
public static Strin
Using NIO you can write to the end of the file in more efficient way
public static void writeToLog(String string) {
String text = getTimestamp() + " " + string;
try {
java.nio.file.Files.write(java.nio.file.Paths.get("/file.txt"), text.getBytes(), java.nio.file.StandardOpenOptions.APPEND);
} catch (IOException ignore) { }
}