Remove an Image from Gallery on Android

We need to inform Media Content Provider :

MediaScannerConnection.scanFile(this, new String[] { pathToFile }, 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.i("ExternalStorage", "Scanned " + path + ":");
                  Log.i("ExternalStorage", "-> uri=" + uri);
              }
            });

References
https://stackoverflow.com/questions/10716642/android-deleting-an-image
https://stackoverflow.com/questions/31932434/how-to-delete-a-file-from-gallery-in-android