title: Rename a file in the internal storage
body: <p>What's the best/easiest way to rename a file in the application's internal storage? I find it a bit strange that there is a <code>Context.deleteFile()</code> method, but no "move" or "rename" function. Do I have to go all the way through saving the file's contents, deleting it, creating a new one and then copying the contents into that one? Or is there a way to copy a file over an existing file?</p>
  
  <p>Update (Aug. 30, 2012):</p>
  
  <p>As per the suggested solution below, which I cannot get to work:</p>
  
  <ul>
  <li>I have a file called shoppinglists.csv</li>
  <li>Then I create a new file called shoppinglists.tmp, and copy the contents from shoppinglists.csv AND some new entries into that. The shoppinglist.tmp file is then a new version of the shoppinglists.csv file</li>
  <li>Then I delete the old shoppinglists.csv file</li>
  <li>Then I need to rename the shoppinglists.tmp file to shoppinglists.csv</li>
  </ul>
  
  <p>I tried this:</p>
  
  <pre><code>ctx.deleteFile("shoppinglists.csv");           &lt;--- delete the old file
  File oldfile = new File("shoppinglists.tmp");
  File newfile = new File("shoppinglists.csv");
  oldfile.renameTo(newfile);
  </code></pre>
  
  <p>However, this doesn't work. After deleteFile(), nothing more happens, and I'm left with the new shoppinglists.tmp file.</p>
  
  <p>What am I missing?</p>
  
  <p>NB: There are no errors or anything in LogCat.</p>