I'm using a Service
which implements com.google.android.gms.common.GooglePlayServicesClient.ConnectionCallbacks
and
com.google.android.gms.common.GooglePlayServicesClient.OnConnectionFailedListener
The service is supposed to upload location updates to a server every minute when it's running. I've googled for tutorials but I can't find any good ones for my scenario.
The methods that I don't know how to implement are:
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
...
}
There are some tutorials suggesting to start an activity with connectionResult.startResolutionForResult(this, CONNECTION_FAILURE_RESOLUTION_REQUEST);
but since this is a Service
(not an Activity) I can't use this method. I thought of sending the connectionResult
in an Intent
to an activity but ConnectionResult
is not serializable.
and
@Override
public void onDisconnected() {
...
}
Should I just call LocationClient#connect()
again in here?