Return to Video

Setting up the Client Quiz

  • 0:00 - 0:04
    When building apps that use the API
    Client, you have the usual onStart() and
  • 0:04 - 0:06
    onStop() methods that
    need to be implemented.
  • 0:06 - 0:10
    Go ahead and do these now, and make
    sure that you connect the API Client to
  • 0:10 - 0:14
    the onStart(), and
    you disconnect it at the onStop().
  • 0:14 - 0:17
    You also need the onPause() and
    the onResume() overrides, and
  • 0:17 - 0:19
    these are a little more
    complicated in this case.
  • 0:19 - 0:21
    So an onPause(),
  • 0:21 - 0:25
    you should get a LocalBroadcastManager,
    and use that to unregister our receiver.
  • 0:25 - 0:29
    For onResume( ),
    you're going to do the opposite.
  • 0:29 - 0:33
    You get the LocalBroadcastManager and
    you re-register the receiver.
  • 0:33 - 0:37
    But make sure when you re-register it,
    you're going to use an IntentFilter.
  • 0:37 - 0:41
    And that IntentFilter should have
    the same name as the one in the service.
  • 0:41 - 0:44
    In which case we called
    it BROADCAST_ACTION.
  • 0:44 - 0:46
    Implement all these now
    in the main activity, and
  • 0:46 - 0:47
    check this box when you're done.
Title:
Setting up the Client Quiz
Description:

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

English subtitles

Revisions Compare revisions