Android 日志输出到本地txt

有时候Logcat日志过长,为了方便查看,我们可以把它存储到text文档。

 

String str = "hello world";
try {
	FileWriter fw = new FileWriter(PATH + "/aa.txt");
	fw.flush();
	fw.write(str);
	fw.close();
} catch (Exception e) {
	e.printStackTrace();
}
String str = "hello world";
try {
	FileWriter fw = new FileWriter(PATH + "/aa.txt");
	fw.flush();
	fw.write(str);
	fw.close();
} catch (Exception e) {
	e.printStackTrace();
} 


 

你可能感兴趣的:(exception,android,String,存储,文档,Path)