且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

更新位置每5秒的android

更新时间:2022-12-29 21:48:44

的setInterval 方法并不精确。 这是文件中提及。

另外,使用相同的时间间隔 setFastestInterval 的setInterval 来prevent您的应用程序接收位置更新比你的的setInterval 指定的时间间隔更快。

Also, use the same interval for setFastestInterval and setInterval to prevent your app from receiving location updates faster than the the interval you specified in setInterval.

只需添加 REQUEST.setFastestInterval(有限区间); 你的 startPeriodicUpdates