我已将间隔和最快间隔设置为,
locationRequest.setInterval(30 * 60 * 1000); //30 minutes
locationRequest.setFastestInterval(30 *60 * 1000); //30 minutes
但我有时会在 30 分钟前收到位置更新,而且时间间隔不均匀。例如,有时会在 3 分钟、4 分钟、10 分钟后收到位置更新。
我的待定意向设置为,
mPendingIntent = PendingIntent.getService(context, 0, mIntentService, PendingIntent.FLAG_UPDATE_CURRENT);
这是预期的行为还是我需要以其他方式处理它?</p>
最佳答案
降低 setFastestInterval
速率很可能会导致更稳定的位置更新。
另请观看此视频了解更多信息: https://youtu.be/81W61JA6YHw
关于android - 在 locationRequest.setFastestInterval 之前收到位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27399120/