4

我一直在使用用户的活动识别Fused 位置提供程序,并注意到即使在我卸载示例应用程序之后,活动识别请求/位置请求仍然会被触发,因为我每隔几秒钟就会看到以下内容:

05-20 23:20:22.569: W/ActivityManager(389): Unable to start service Intent { cmp=com.example.android.activityrecognition/.ActivityRecognitionIntentService (has extras) } U=0: not found

异常显然来自我的服务消失(应用程序已卸载)这一事实。

我在位置提供商那里看到了同样的情况。

因此,如果像这样使用未决意图

Intent intent = new Intent(Constants.INTENT_ACTION_LOCATION_UPDATED);
PendingIntent pendingIntent = PendingIntent.getService(BasicMapActivity.this, LOCATION_INTENT_CODE, intent, 0);
LocationRequest locationRequest = LocationRequest.create().setInterval(5000).setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
locationClient.requestLocationUpdates(locationRequest, pendingIntent);

如果应用程序被卸载或应用程序崩溃并且没有发生适当的“用户清理”,这可能会一直让 GPS 轮询某个位置。

这是正常行为吗?我想在删除应用程序时会对 PendingIntents 进行一些清理。

这是否与这些请求流经 Google Play 服务流程有关?

我们应该如何处理?

编辑:在Android 跟踪器中发布了一个问题,但被告知这不是报告 Google Apps 问题的正确位置。将其发布在Google 移动帮助论坛上

4

0 回答 0