【发布时间】:2015-07-11 15:04:56
【问题描述】:
我有两个意图服务: 1. 使用 Fused Location API 在后台接收位置更新。 2. 使用Activity Recognition API在后台接收Activity Recognition。
每当我检测到用户静止不动时,我希望能够将融合位置的优先级从 PRIORITY_HIGH_ACCURACY 更改为 PRIORITY_BALANCED_POWER_ACCURACY。
我听说过 removeLocationUpdates() 然后调用 requestLocationUpdates() 但我不能使用它,因为我只在后台运行没有活动的意图服务。
任何帮助都会有所帮助。
【问题讨论】:
-
为什么不能在活动识别
IntentService中调用requestLocationUpdates()? -
因为 GoogleApiClient 没有在那里连接,并且意图服务根本不知道 GoogleApiClient 对象......有什么办法可以将该对象从活动发送到意图服务?
标签: android google-play android-fusedlocation