Android 检测 SD 卡何时挂载
我正在编写一个在启动时运行的应用程序,但它需要 SD 卡,因此我需要一种方法来检测 SD 卡何时安装,以便我的应用程序可以在安装 SD 卡后开始执行需要执行的操作。 如果这是不可能的,我怎样才能让应用程序休眠 20 秒,我需要做什么才能实现这一点,您可以粘贴代码吗? 感谢您的帮助
I'm writing an app that runs at boot up but it requires the sdcard so i need a way to detect when the sdcard has mounted so that my app can start doing what it needs to do once the sdcard is mounted.
If this is not possible how can i have the app sleep for say 20 seconds what would i have to do to make that happen could you paste the code please.
Thanks for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如何为 广播接收器 注册/developer.android.com/reference/android/content/Intent.html#ACTION_MEDIA_MOUNTED" rel="nofollow">ACTION_MEDIA_MOUNTED?
How about registering a broadcast receiver for ACTION_MEDIA_MOUNTED?