【发布时间】:2014-05-19 07:36:21
【问题描述】:
我正在使用 Android Location API 来注册地理围栏。
是否可以在 IntentService 的 onHandleIntent() 方法或 onReceive() 方法(使用 BroadcastReceiver 时)中获取触发 Geofence-Exit 事件的用户位置?
我目前的方法是使用LocationManager.getLastKnownLocation(String provider),但我不确定这是否可靠,因为我必须指定一个提供商,而且我不知道我的地理围栏位置基于哪个提供商。
onHandleIntent(Intent int) 或onReceive(Intent intent) 中收到的 Intent 也不包含任何有用的位置数据。
长话短说:
是否有一种安全/可靠的方式来获取在 Android 中触发地理围栏事件的位置?
【问题讨论】:
标签: broadcastreceiver intentservice android-geofence