是Android的geofences尚存重新启动? [英] Are Android geofences surviving a reboot?

查看:114
本文介绍了是Android的geofences尚存重新启动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在系统坚持他们还是必须重新启动后,再次将它们添加呢?我还没有发现有关的文档中任何事情<一href="https://developer.android.com/training/location/geofencing.html">https://developer.android.com/training/location/geofencing.html

is the system persisting them or do I have to add them again them after reboot? I have not found anything about that in the documentation at https://developer.android.com/training/location/geofencing.html

推荐答案

Geofences将不会保留在重新启动。我已经测试,你可以在这里找到样品

Geofences will not persist on reboot. I have tested and you can find the sample here.

您要听的 BOOT_COMPLETED 操作,然后重新添加geofences。

You have to listen for BOOT_COMPLETED action and add geofences again.

注意::如果您的应用程序安装在外部的存储(SD卡),你将永远不会收到完整的引导作用。所以,你必须指定机器人:INSTALLLOCATION =internalOnly清单标签。 这是因为,Android设备将播出BOOT_COMPLETED行动之前,设置外部存储。

Note: If your app installed on external storage(SD card), you will never receive Boot Complete action. So you have to specify android:installLocation="internalOnly" in the manifest tag. This is because, android device will broadcast BOOT_COMPLETED action before setting up the external storage.

这篇关于是Android的geofences尚存重新启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆