开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜