Return to Video

onHandleIntent Transition - Solution

  • 0:01 - 0:04
    So here now we can see we
    can get the transition type
  • 0:04 - 0:07
    using
    geofencingEvent.getGeofenceTransition.
  • 0:07 - 0:10
    This is going to return
    an integer to us.
  • 0:10 - 0:15
    Now, the geofence object contains these
    constants GeofenceTransitionEnter and
  • 0:15 - 0:18
    GeofenceTransitionExit.
  • 0:18 - 0:22
    So all we have to do then is if
    the geofence transition is this or
  • 0:22 - 0:26
    the geofence transition is this,
    then we're going to run a block of code.
  • 0:26 - 0:29
    We'll see what that block of
    code is in a few moments, but
  • 0:29 - 0:31
    this is all you'll have to do to check
  • 0:31 - 0:35
    the transition type if you're
    entering or if you're existing.
  • 0:35 - 0:37
    Of course, it's up to you how
    you build your application.
  • 0:37 - 0:40
    If you want to build it so
    that events only happen when you enter,
  • 0:40 - 0:44
    then you don't need to check for the
    geofence transition exit and vice versa.
Tytuł:
onHandleIntent Transition - Solution
Opis:

more » « less
Video Language:
English
Team:
Udacity
Projekt:
UD876-1 - Google Play Services - Location & Contex
Duration:
0:45

English subtitles

Revisions Compare revisions