使用安装到 SD 卡的应用程序接收系统广播的解决方法?
安装到 SD 卡的应用程序似乎不会收到任何系统广播。但是,我们希望在启动时启动一项服务来侦听推送通知。
我们不想放弃app2sd,因为它是许多用户要求的功能,那么有没有办法同时拥有两者呢?
It seems as if applications installed to the SD card do not receive any system broadcasts whatsoever. However, we'd like to start a service at boot time that listens for push notifications.
We'd hate to abandon app2sd, since it's a feature that was asked for by many users, so is there any way to have both?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 Android bug 8485,SD 卡上的应用程序不会收到
EXTERNAL_APPLICATIONS_AVAILABLE
广播。这对我来说没有意义,所以希望这个问题能得到解决。同时,解决方法是监听
CONNECTIVITY_CHANGE
来自系统的广播,并在网络可用时将其用作触发器启动您的服务。According to Android bug 8485, applications on the SD card do not receive the
EXTERNAL_APPLICATIONS_AVAILABLE
broadcast. That doesn't make sense to me, so hopefully that gets fixed.Meanwhile, a workaround would be to listen for
CONNECTIVITY_CHANGE
broadcasts from the system and use that as a trigger start your service once the network becomes available.外部 SD 卡将在 BOOT_COMPLETE 和其他系统意图广播后安装。
External SD card will be mounted after BOOT_COMPLETE and other system intents broadcasted.