Android:收到 MEDIA_BAD_REMOVAL 通知
我有一个应用程序可以扫描 SD 卡并列出存储在其中的视频文件列表。然后有一个播放视频文件的选项。我想知道的是
1-如何在清单文件中注册各种操作或通知,例如 Action.Media.Unmount、Action.Media.Bad.Removal 等 2-我如何在我的代码中使用广播接收器..我尝试了几个代码,但它们不起作用。如果有人可以在这里给我一个例子,我将非常感激..
谢谢大家
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你真的应该阅读文档。为这些 Intent 注册 BroadcastReceiver 是一个相当简单的方法。
只需阅读 此处和此处。
如果阅读后您仍然遇到某种问题,请说明您遇到的错误以及您正在使用的代码/xml。
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.