标签:array 文本 exce nfc 文件中 external new writer close
list列表数据导出到指定路径文本文档中
public String getSDCardPath() {
String sdCard = Environment.getExternalStorageDirectory().getAbsolutePath();
sdCard = sdCard + File.separator;
return sdCard;
}
String mExportPath=getSDCardPath() + "TianChao/"+"Export/";
File file =new File(mExportPath);
if(!file.exists()){
file.mkdirs();
}
String filename="nfc.txt";
filename=filename.replaceAll("nfc",mTagNameNew);
File f=new File(mExportPath+filename);
try {
BufferedWriter bw=new BufferedWriter(new FileWriter(f));
for(String s: mNFCs){
bw.write(s);
bw.write("\r\n");
bw.flush();
}
bw.close();
} catch (Exception e) {
}
标签:array 文本 exce nfc 文件中 external new writer close
原文地址:https://www.cnblogs.com/spps/p/8761329.html