Search code examples
androidbroadcastreceiversd-card

Android: receiving MEDIA_BAD_REMOVAL notification


I have an application that scans the sd-card and make a list of video files stored in it. Then there is an option of playing the video files. All I want to know is

1- How can I register various actions or notifications like Action.Media.Unmount, Action.Media.Bad.Removal etc in my Manifest file 2- How can I use the braodcast receiver in my code.. I have tried couple of codes but they didn't work. If someone can give me of an example here, I shall be greatly thankful..

Thanks all


Solution

  • You really should read the documentation. It's a fairly simple method to register a BroadcastReceiver for those Intents. Just read here and here.

    If, after reading you still have some kind of problem, just say what error are you getting and the code/xml you're using.