When using Lost, GoogleApiClient
is replaced by LostApiClient
.
After calling lostApiClient.connect()
you should wait for ConnectionCallbacks#onConnected()
before performing other operations like getting the last known location or requesting location updates.
LostApiClient lostApiClient = new LostApiClient.Builder(this).addConnectionCallbacks(this).build();
lostApiClient.connect();
@Override public void onConnected() {
// Client is connected and ready for use
}
@Override public void onConnectionSuspended() {
// Fused location provider service has been suspended
}