I am writing an app that uses Google's location services. From what I understand, when I call the connect()
method on a LocationClient
object, the object that implementsGooglePlayServicesClient.ConnectionCallbacks
is supposed to receive an onConnected()
callback only if the LocationClient
succeeds in connecting to Google's location services.
The problem, however, is that I receive this callback even if my phone is not connected to the internet. Somehow, the system must think that the LocationClient
is successfully connecting to Google's location services even though my phone is not connected to the internet.
What gives?
Here are the relevant code snippets:
@Override
protected void onStart() {
super.onStart();
mLocationClient.connect();
}
@Override
public void onConnected(Bundle bundle) {
Toast.makeText(this, "Connected", Toast.LENGTH_SHORT).show();
}