I am having problem with media scanner, in my program i am running media scanner through…
sendBroadcast(new Intent(
Intent.ACTION_MEDIA_MOUNTED,
Uri.parse("file://" + Environment.getExternalStorageDirectory())));
this above code works but it runs as async which is bit paining for me.
Is there any way to stop till mediascanner complete it’s work.
i am fetching list of music file from the sd card, and the problem is list is getting fetched before mediascanner return it’s result.
instead of using Intent.ACTION_MEDIA_MOUNTED, you could use Intent.ACTION_MEDIA_SCANNER_FINISHED instead.
You can find all the intents you want here.