title: Android : Delete file from public external storage
body: <p>I'm trying to delete files from public directories (Pictures, Movies, Download,...) on external storage. I have found some similar questions on SO but none of the answers works for me.</p>
  
  <p>Here is the code :</p>
  
  <pre><code>File file = new File("/storage/emulated/0/Pictures/IMG_20131107_142745.jpg");
  if (file.exists() &amp;&amp; file.canWrite()) {
      file.delete()
  }
  </code></pre>
  
  <p>The deleted file is effectively no longer visible in my app but i can still see it with MTP on my laptop. However it seems to be a corrupted file and I can't open it. The only way to get rid of it, is to delete the file manually or to reboot the smartphone.</p>
  
  <p>It works perfectly fine on the emulator when I browse the content with the Android Device Monitor</p>