Reputation: 18169
I am using the Google Maps Android API v2 LocationClient in my Android application: http://developer.android.com/reference/com/google/android/gms/location/LocationClient.html
I am calling connect() and disconnect() myself.
I have also registered a listener for GooglePlayServicesClient.ConnectionCallbacks: http://developer.android.com/reference/com/google/android/gms/common/GooglePlayServicesClient.ConnectionCallbacks.html
I am observing that the callback onConnected() is called on the listener after calling connect() on the LocationClient.
However it seems that onDisconnected() is never called on the listener after calling disconnect() on the LocationClient.
Is this the normal behaviour?
Upvotes: 1
Views: 860
Reputation: 330
I guess it's a bit late but I was wondering the same, so I'll reply.
It's normal behaviour. It's not clear from the API documentation, but in the official tutorial at http://developer.android.com/training/location/retrieve-current.html, it says about onDisconnected:
Called by Location Services if the connection to the location client drops because of an error.
Which means it shouldn't be called if you call disconnect() yourself.
Upvotes: 2