title: append to file android
body: <p>hey there, i need to append to my file but it is not working, it keeps overwriting the file,  can anyone please tell me what is wrong:</p>
  
  <pre><code>  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();
          }
         } 
  </code></pre>
  
  <p>Thanks in advance.</p>