English subtitles

← Today Item on Tablet - Developing Android Apps

Get Embed Code
10 Languages

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

  1. In the MainActivity,
    we tell the forecast fragment
  2. to use a special today layout
    if it's one pane mode.
  3. In the fragment,
    we pass on this value
  4. to the forecast adapter,
    if it's not null.
  5. The reason it could be null,
    is because the activity onCreate method
  6. will happen before the fragment
    onCreate view method.
  7. And this is where
    the forecast adapter is initialized.
  8. So we set the Boolean here as well.
  9. The reason we have this code here
    is because it's a public method.
  10. So, in the future it could be called
    before or after this method.