YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Notifications - Developing Android Apps

Get Embed Code
10 Languages

Showing Revision 18 created 05/25/2016 by Udacity Robot.

  1. All right, you're done.
    There were a lot of new things
  2. that time.
    But, after all,
  3. you're becoming a seasoned
    Android programmer by now.
  4. As I mentioned before,
    we're going to use
  5. NotificationCompat.Builder
    to build our notification.
  6. It's easy to build a nice looking
    notification that has our icon
  7. representing the weather forecast,
    the title for our app.
  8. And our content text, the forecast
    with highs and lows.
  9. We're going to use another class
  10. from the support library,
    to create a task stack builder
  11. for our pending intent.
    This is a simple case
  12. of task stack builder,
    because all we have
  13. is a single item on our stack.
    We just add the next intent
  14. and use it to build out pending intent
  15. that we pass
    into the notification manager.
  16. Finally we call the notification manager
    with the built intent from our builder,
  17. with a notify function.
    One of the great things
  18. about notification manager
    is it can be used from any thread
  19. even though it is displaying UI.