How do I insert line breaks into a text file i'm creating on the SD Card?
My code is pretty standard.. sReport contains the text I would like output to the text file, and it contains several "\n" line breaks that render fine in a textview, but in the text file they're non-existent. There must be something easy i'm missing..
try {
FileOutputStream fOut = new FileOutputStream(sDir + sFile);
//write
fOut.write( sReport.getBytes() );
// Close output开发者_开发知识库 stream
fOut.flush();
fOut.close();
} catch (IOException e) {
e.printStackTrace();
}
please review this and keep in mind Android is Linux based.
精彩评论