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("
");
bw.flush();
}
bw.close();
} catch (Exception e) {
}