com.google.android.gms.location.LocationAvailability

Here are the examples of the java api class com.google.android.gms.location.LocationAvailability taken from open source projects.

1. LocationProvider#onConnected()

View license
@Override
public void onConnected(Bundle bundle) {
    Log.i(TAG, "Connected to location services");
    LocationAvailability locationAvailability = mFusedLocationProviderApi.getLocationAvailability(mGoogleApiClient);
    if (!locationAvailability.isLocationAvailable()) {
        mLocationCallback.handleLocationNotAvailable();
        return;
    }
    Location lastKnownLocation = mFusedLocationProviderApi.getLastLocation(mGoogleApiClient);
    mFusedLocationProviderApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
    if (lastKnownLocation != null) {
        Log.i(TAG, "Received last known location: " + lastKnownLocation);
        mCurrentBestLocation = lastKnownLocation;
        if (mBearing != null) {
            mCurrentBestLocation.setBearing(mBearing);
        }
        mLocationCallback.handleNewLocation(mCurrentBestLocation);
    }
}