Skip to content

Instantly share code, notes, and snippets.

@markchristopherng
Created October 13, 2018 01:45
Show Gist options
  • Save markchristopherng/11a01cbf06bab4490b0c4ec8961be2e8 to your computer and use it in GitHub Desktop.
Save markchristopherng/11a01cbf06bab4490b0c4ec8961be2e8 to your computer and use it in GitHub Desktop.
@Override
public void onReceive(Context context, Intent intent) {
FenceState fenceState = FenceState.extract(intent);
String geoFenceKey = fenceState.getFenceKey();
switch (fenceState.getCurrentState()) {
case FenceState.TRUE:
Timber.d("fence %s detected", geoFenceKey);
break;
case FenceState.FALSE:
Timber.d("fence %s false", geoFenceKey);
break;
case FenceState.UNKNOWN:
Timber.d("fence %s unknown", geoFenceKey);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment