Skip to content

Instantly share code, notes, and snippets.


FilHazer/ Secret

Created Jan 22, 2016
What would you like to do?
public class GeoIntentService extends IntentService{
private String LOG_TAG = "DEBUG";
public GeoIntentService() {
protected void onHandleIntent(Intent intent) {
Log.i(LOG_TAG, "onHandleIntent");
GeofencingEvent event = GeofencingEvent.fromIntent(intent);
if (event == null) {
if (event.hasError()) {
Log.i(LOG_TAG, "ERROR");
int transition = event.getGeofenceTransition();
if (transition == Geofence.GEOFENCE_TRANSITION_ENTER){
Log.i(LOG_TAG, "ENTER");
} else if(transition == Geofence.GEOFENCE_TRANSITION_DWELL ){
Log.i(LOG_TAG, "DWELL");
}else if(transition == Geofence.GEOFENCE_TRANSITION_EXIT) {
Log.i(LOG_TAG, "EXIT");
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.