title: How to rename File From filepath in Android?
body: <p>I have Path Which is stored into one variable That is</p>
  
  <h2>String Path:</h2>
  
  <blockquote>
    <p>String filepath="/mnt/sdcard/DCIM/Camera/1396854069062.jpg";</p>
  </blockquote>
  
  <p>Now i want to rename only file that is <strong>1396854069062.jpg</strong> I Reilly don't have any idea for how to do that.</p>
  
  <h2>My Code Is:</h2>
  
  <pre><code>File sdcard = Environment.getExternalStorageDirectory();
  File from = new File(sdcard, filePath);
  File to = new File(sdcard, "RChat_Rename.jpg";
  from.renameTo(to);
  </code></pre>
  
  <p>Any help will b appreciated.</p>
  
  <p>Thank You</p>