【发布时间】:2016-04-09 08:19:08
【问题描述】:
我正在使用 Fused location provider 来根据用户需要获得频繁的位置更新。使用 BroadCast Reciever 通过 LocationRequest 类接收位置更新。
我正在使用待定意图初始化接收方。
mPendingIntent = PendingIntent.getBroadcast(this, 1, mIntentService, 0);
并从融合提供商处获取位置更新。
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient,mLocationRequest, mPendingIntent);
所有这些在一段时间内都进展顺利。过了一段时间后说 2 小时或更长时间,然后突然 BroadCast Reciever 没有收到任何更新,而且它是如此不寻常,以至于它没有理由停止。
我没有停止应用程序或停止从 FusedLocationApi
接收位置更新【问题讨论】:
-
你看logcat了吗?里面有什么有趣的吗?另外,这仅在 Marshmallow 上还是在较旧的 api 上?
-
This SO issue可能与您的询问有关。
-
@Shmuel 未指定给任何版本,它很常见。 logcat 没什么特别的
-
@adjuremods 没有可接受的答案,我将如何尝试。
标签: android google-maps fusedlocationproviderapi