質問

My application must get the coordinates every 100m or every 150 seconds. If the last position was less far then 80m (so i must have the new coordinate even if i'm still in the same place), the application can end correctly. I found the requestLocationUpdates(provider, minTime, minDistance, locationListener) but the minTime is just a hint (i get the new point every 100m, but if i stay in the same point, nothing happens). Is there a way to resolve this?

役に立ちましたか?

解決

If you don't get an event within minTime time, you know you haven't moved and you can pretend you did get that event.

他のヒント

requestLocationUpdates(provider, minTime, minDistance, locationListener)

In this you will also recieve a location may be similar to the previous one after every minTime interval look at the docs

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top