Skip to content Skip to sidebar Skip to footer

Media_mounted Broadcast Not Being Received

I'm baffled. I'm trying to configure my app to respond to the SD card becoming available / going offline, but my broadcast receiver never gets called! I can see the event being bro

Solution 1:

You can't be serious. Apparently I needed to add an additional filter for the data type.

Leaving the answer up for "the next guy"...

<receiverandroid:name=".Test"android:enabled="true"><intent-filter><actionandroid:name="android.intent.action.MEDIA_MOUNTED" /><dataandroid:scheme="file"/></intent-filter></receiver>

Solution 2:

You try adding the <data android:scheme="file" /> tag in the <intentfilter>, else do the registration at run time. At run time, create an object of your broadcast receiver and pass it to registerReceiver(obj).

Post a Comment for "Media_mounted Broadcast Not Being Received"