when I enter the interface, I start to call the location function to get the current longitude and latitude from onLocationChanged. When
automatically relocates 10 seconds later, most of the latitude and longitude returned to me by onLocationChanged are zero and zero. Why is this happening? Is it because my position has not moved, so return to 0 for me? Or some other reason, ask the boss to explain, thank you!
private AMapLocationListener locationListener = new AMapLocationListener() {
@Override
public void onLocationChanged(AMapLocation aMapLocation) {
if (null != aMapLocation) {
location = aMapLocation;
getLocation(aMapLocation);//location0
Log.i("tang","="+location.getLatitude()+"//"+location.getLongitude());
System.out.println("===========" + getLocationStr(aMapLocation));
} else {
System.err.println("===========");
}
}
};
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)