Trigger media rescan
Posted: 11 Dec 2013 12:00
Hi Martin,
I've created a flow that moves certain media files from the internal to the external sdcard. The issue I have is that the gallery app still thinks the media is in the internal sdcard. So I've tried to google a way to do it, and found out that you can broadcast an intent to the trigger a rescan, but that doesn't work (or might have in the past, but not in kitkat). The official way would be to use a MediaScannerConnection, but - naturally - that isn't possible without you putting the feature in
. Would it be possible to create an action that can trigger a media rescan?
Thanks
Loris
I've created a flow that moves certain media files from the internal to the external sdcard. The issue I have is that the gallery app still thinks the media is in the internal sdcard. So I've tried to google a way to do it, and found out that you can broadcast an intent to the trigger a rescan, but that doesn't work (or might have in the past, but not in kitkat). The official way would be to use a MediaScannerConnection, but - naturally - that isn't possible without you putting the feature in

Code: Select all
MediaScannerConnection.scanFile(context, paths /*String[]*/, mimeTypes /*String[]*/, null /* optional listener callback */
Loris