嘿在那里,我需要附加到我的文件,但它不工作,它不断覆盖文件,任何人可以告诉我什么是错的:
public void generateNoteOnSD(String sBody){ try { File root = new File(Environment.getExternalStorageDirectory(),"AdidasParticipants"); if (!root.exists()) { root.mkdirs(); } File gpxfile = new File(root,"participants.txt"); BufferedWriter bW; bW = new BufferedWriter(new FileWriter(gpxfile)); bW.write(sBody); bW.newLine(); bW.flush(); bW.close(); //Toast.makeText(mContext,"Tus datos han sido guardados",Toast.LENGTH_SHORT).show(); } catch(IOException e) { e.printStackTrace(); // importError = e.getMessage(); // iError(); } }
提前致谢.