How can I change the interval of LocationRequest

前端 未结 1 1400
滥情空心
滥情空心 2021-02-20 10:59

I set my application to get location notification every 5 seconds.

    mLocationRequest = LocationRequest.create();
    mLocationRequest.setPriority(LocationRequ         


        
相关标签:
1条回答
  • 2021-02-20 11:58

    Hope this answer isn't too late, but simply create a LocationRequest object, with the desired setInterval value. And then just call requestLocationUpdates with it.

    I used this with tabs where 1 tab had to get location updates faster than the others. So I just changed the interval in the onResume and onPause methods.

    0 讨论(0)
提交回复
热议问题