Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class AddGeoConnectionCallBack implements GoogleApiClient.ConnectionCallbacks{
private String LOG_TAG = "DEBUG";
@Override
public void onConnected(Bundle bundle) {
Intent intent = new Intent(GeofenceApplication.CONTEXT, GeoIntentService.class);
PendingIntent pendingIntent = PendingIntent.getService(GeofenceApplication.CONTEXT, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
PendingResult<Status> result = LocationServices.GeofencingApi.addGeofences(GeofenceController.getInstance().getGoogleApiClient(), GeofenceController.getInstance().getAddGeofencingRequest(), pendingIntent);
result.setResultCallback(new ResultCallback<Status>() {
@Override
public void onResult(Status status) {
if (status.isSuccess()) {
Log.i(LOG_TAG, "SUCCESS" + status);
} else {
Log.i(LOG_TAG, "FAILED: " + status.getStatusMessage() + " : " + status.getStatusCode());
}
}
});
}
@Override
public void onConnectionSuspended(int i) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.