title: How to rename a file on sdcard with Android application?
body: <p>In my Android application, I want to rename the file name at runtime. How can I do it?</p>
  
  <p>This is my code:</p>
  
  <pre><code>String[] command = {" mv", "sun moon.jpg"," sun_moon,jpg"};
  try
  {
      Process process = Runtime.getRuntime().exec(command);
  } 
  catch (IOException e)
  {
      Toast.makeText(this, ""+e, Toast.LENGTH_LONG).show();
  }
  </code></pre>
  
  <p>I also used renameTo(File f) method but it does not work.</p>