title: How do you overwrite instead of append to a text file in Android?
body: <pre><code>File myDir = new File(getFilesDir().getAbsolutePath());
  FileWriter fw = new FileWriter(myDir + "/score.txt");
  fw.write("Hello World");
  fw.close();
  </code></pre>
  
  <p>The above code appends to the text file. How do you make it overwrite?</p>