English subtitles

← Display Content in DetailActivity - Developing Android Apps

Get Embed Code
10 Languages

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

  1. In the fragment detailed layout,
    a text view is already defined.
  2. We have to assign it an ID
    so that within the detail fragment
  3. of detail activity we can use
    view by ID to find the text view.
  4. To determine the forecast info
    that the text view should display,
  5. we can access the intent
    that the detail activity was launched by.
  6. We're going to use
    this inside of onCreateView.
  7. (clicking, pressing key)
  8. Since we added an intent extra
    with the forecast data there,
  9. we can read that intent extra
    back to display in the text view.
  10. As you can see, we pulled
    the forecast string
  11. from the intent, find our rootView,
    and then set the text
  12. to that forecast string.