I am using Google new location Api in my app like this
private static final LocationRequest REQUEST = LocationRequest.create().setInterval(2000).setFastestInterval(1000)
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
private LocationListener mLocationListener = new LocationListener() {
@Override
public void onLocationChanged(final Location location) {
if(location.hasAltitude()){
Log.e(TAG, "Altitude " + location.getAltitude());
}else{
Log.e(TAG, "Location does not have altitude");
}
}
};
but location.hasAltitude()
always false, I have tested it on real device and in open area, but it does not have altitude anywhere, but if I am using the old location Listener, its working fine,