I am using LocationListener on my application. However, whenever my location changes or onLocationChanged(Location location) method is executed, the coordinates of my location does not change at all. I am riding inside a car and had traveled several meters to kilometers already without my location changing. What could be the problem?
我的法典:
LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
String bestProvider = locationManager.getBestProvider(new Criteria(), true);
{LocationListener locationListener = new LocationListener()
{
public void onLocationChanged(Location location)
{
//location.getLatitude(), location.getLongtitude()
//location coordinates does not change at all everytime onLocationChanged is called even after I already move several meters or kilometers.
}
//...
}
locationManager.requestLocationUpdates(bestProvider, 0, 0, locationListener);