Return to Video

onActivityResult

  • 0:00 - 0:03
    Step 9 is to implement
    the onActivityResult.
  • 0:03 - 0:06
    Now, the onActivityResult
    override takes three parameters.
  • 0:06 - 0:09
    There's an int for the request code,
    there's an int for the response code,
  • 0:09 - 0:11
    and there's an Intent.
  • 0:11 - 0:13
    The only thing we're really
    interested in checking for is,
  • 0:13 - 0:18
    on the request code to see if
    we're an RC_SIGN_IN and if we are,
  • 0:18 - 0:20
    we take a look at the response code.
  • 0:20 - 0:25
    If the response code is Result_OK, then
    we want to set our signed in status to
  • 0:25 - 0:28
    STATE_SIGN_IN, which basically means
    that we want to keep catching errors and
  • 0:28 - 0:32
    handling errors because they may be
    more intent, such as the account or
  • 0:32 - 0:35
    such as the permission screen.
  • 0:35 - 0:37
    Otherwise if it's not Result_OK,
  • 0:37 - 0:40
    then we know we're actually
    in a signed in state.
  • 0:40 - 0:41
    So we're good to go.
  • 0:41 - 0:44
    We just set our sign in
    status to be signed in.
  • 0:44 - 0:47
    This is everything that
    the onActivityResult needs to do.
  • 0:47 - 0:49
    See if you can implement it,
    I know it's a little tricky.
  • 0:49 - 0:52
    If you get stuck,
    the code is in the speaker notes.
  • 0:52 - 0:53
    But check this box when you're done.
Tytuł:
onActivityResult
Opis:

more » « less
Video Language:
English
Team:
Udacity
Projekt:
ud876-5 - Google Play Services - Identity
Duration:
0:55

English subtitles

Revisions Compare revisions