-
-
Save FilHazer/5dbece94a7504de286e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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