I have the following line
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + fileOnDownload)));
Where fileOnDownload
is the path of the file like this one:
/storage/emulated/0/Downloads/song.mp3
But sometimes when the broadcast is sent, it doesn't reload the MediaStore
(on Android O at least)
You can see the full code here
I'm pretty new to Android MediaStore
so don't be too rude, please :)