手机重启后接近警报不起作用
我在我的一个应用程序中使用接近警报,但是,每当我重置手机(通过电池拉动)或一般情况下,接近警报似乎不再处于活动状态。
他们再次工作的唯一方法是,如果我取消选中并重新选中复选框(删除,然后重新添加接近警报)
有什么想法或原因吗?
I am using proximity alerts in one of my applications, however it seems that whenever I reset my phone (via battery pull) or just in general, the proximity alerts are no longer active.
The only way they work once again is if I uncheck and recheck the checkbox (which removes, then re-adds the proximity alert)
Any idea's or reason?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须重置警报。 Android 操作系统在重新启动时不会保留您的警报,这取决于您的应用程序。创建一个 BroadcastReceiver(我在下面的示例中称为 BootReceiver)来处理“android.intent.action.BOOT_COMPLETED”操作(这是在清单中定义的)。使用 BroadcastReceiver,您可以重新启动所有警报。不要忘记添加“android.permission.RECEIVE_BOOT_COMPLETED”权限。
You must reset the alerts. The Android OS does not persist your alerts when rebooting, that's up to your app. Create a BroadcastReceiver (I called mine BootReceiver in my example below) to handle the "android.intent.action.BOOT_COMPLETED" action (this is defined in the manifest). With the BroadcastReceiver you can then restart all of your alerts. Don't forget to add the "android.permission.RECEIVE_BOOT_COMPLETED" permission.