title: file.delete() in Android leaves a small unreadable file
body: <p>I am trying to delete an image from my gallery. I'm using the code I got from here:<br>
  <a href="https://stackoverflow.com/questions/10716642/android-deleting-an-image">android : deleting an image</a></p>
  
  <p>It seems to work for some people, but unfortunately not for me. If I run it, a small, unreadable file remains behind. I'm on Android 4.1.2.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>public void deleteImage(File fdelete) {
      //String file_dj_path = Environment.getExternalStorageDirectory() + "/ECP_Screenshots/abc.jpg";
      //File fdelete = new File(file_dj_path);
      if (fdelete.exists()) {
          if (fdelete.delete()) {
              Log.e("--&gt;", "file Deleted :" + fdelete);
              callBroadCast();
          } else {
              Log.e("--&gt;", "file not Deleted :" + fdelete);
          }
      }
  }
  
  public void callBroadCast() {
      if (Build.VERSION.SDK_INT &gt;= 14) {
          Log.e("--&gt;", " &gt;= 14");
          MediaScannerConnection.scanFile(this, new String[]{Environment.getExternalStorageDirectory().toString()}, null, new MediaScannerConnection.OnScanCompletedListener() {
              /*
               *   (non-Javadoc)
               * @see android.media.MediaScannerConnection.OnScanCompletedListener#onScanCompleted(java.lang.String, android.net.Uri)
               */
              public void onScanCompleted(String path, Uri uri) {
                  Log.e("ExternalStorage", "Scanned " + path + ":");
                  Log.e("ExternalStorage", "-&gt; uri=" + uri);
              }
          });
      } else {
          Log.e("--&gt;", " &lt; 14");
          sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,
                  Uri.parse("file://" + Environment.getExternalStorageDirectory())));
      }
  }
  </code></pre>