1
I have an application that handles images, in it has options to move and delete images, when I delete an image is sent a boradcast so that the android gallery application recognize that the image is no longer there. Is working perfectly, except for Android 4.4!
I’m wearing it like this:
public void forceMediaScan(String path){
File f1 = new File(path);
Intent scanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
scanIntent.setData(Uri.fromFile(f1));
getActivity().sendBroadcast(scanIntent);
}
I’ve searched and tried to use scanFile, but it doesn’t work, the Gallery application of Android 4.4 does not recognize the change
MediaScannerConnection.scanFile(getActivity(), new String[]{path}, null,null);
I have tried using scanFile for a specific file and for an entire path (which is the case for the example), but it does not work.