How to fetch the current Location in every 1 min of interval?

前端 未结 1 1157
悲&欢浪女
悲&欢浪女 2021-01-26 04:58

I have implemented the Demo to show the current lat-long of the User. Now I am able to see the lat-long of the current Position. but I want to Set it to to be displayed in every

相关标签:
1条回答
  • 2021-01-26 05:59
    lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, lListener);
    

    The argument in the method signify - provider, time, distance and the location listener.

    Therefore to request an update from the Location listener you need to set the second parameter to 1000*60, because the time is recorded in milliseconds.

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