title: Move/Rename file in SD Card
body: <p>I'm trying to move a file from one directory to another (in SD Card)</p>
  
  <p>I have a file's URI and the way I'm trying to move it:</p>
  
  <pre><code>Uri selectedImage = imageReturnedIntent.getData(); // this the uri, something like content://media/external/images/media/635
  
  File sdcard = Environment.getExternalStorageDirectory();
  File from = new File(sdcard, selectedImage);
  File to = new File(sdcard, "myNewDir/mynewfile.jpg");
  from.renameTo(to);
  </code></pre>
  
  <p>But it doesnt work, neither does it give me any error in Logcat...</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I have added both permissions to my manifest file:</p>
  
  <pre><code>   &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
     &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  </code></pre>