title: How to Delete all Photos in android Device
body: <p>I have the following code to delete all photos in the <code>DCIM</code> folder and <code>download</code> folder:</p>
  
  <pre><code>Uri uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
  String[] projection = new String[] {MediaStore.Images.Media._ID, 
                                      MediaStore.Images.Media.DATA};
  ContentResolver cr = getApplicationContext().getContentResolver();
  Cursor cur = cr.query(uri, projection, null, null, null);
  if (cur != null) {
      while (cur.moveToNext()) {
          File path =new File(cur.getString(cur.getColumnIndex(MediaStore.Images.Media.DATA)));
          path.delete();
      }
      cur.close();
  }
  </code></pre>
  
  <p>But this code did not delete the photos in the Gallery app which you can find it in applications menu.</p>
  
  <p>Do you have any idea how can I delete all the photos in the android device at once?</p>