My device always gives me location updates wrongly first time and after some time it shows currectly.I had given time 5000 ms for location updates in LocationListener. But first time my application loads I need quick location update after that need it is ok, in round robin manner.How to make change in my snippet for first time use
locationManager.requestLocationUpdates(bestProvider, 5000, 0, this);
Please give me guidance?
Regards, rajend开发者_如何学运维ar
You shouldn't rely on immediate location values. It can take a long time to acquire satelites etc.
If you would just like a rough estimate, use getLastKnownLocation()
Set your location update to 0 instead of 5000, then set it to 5000 after the first update?
精彩评论