Return to Video

Daily Special Files - Solution

  • 0:00 - 0:03
    Okay, let's take a look at the code.
  • 0:03 - 0:07
    Over here, in activity_main.xml
    is the code for the new button.
  • 0:07 - 0:11
    It's very similar to the other buttons,
    and the onClick is showDailySpecial.
  • 0:11 - 0:12
    And see here.
  • 0:12 - 0:13
    Just the third button.
  • 0:13 - 0:15
    It just shows up as another
    button on the main screen.
  • 0:15 - 0:18
    And here's the code in main
    activity that gets invoked
  • 0:18 - 0:20
    when the user clicks show
    daily special button.
  • 0:20 - 0:23
    Very simple, takes a view,
    because it's a button on click and
  • 0:23 - 0:27
    it sends an intent to start
    the show daily special activity.
  • 0:27 - 0:30
    Let's take a look at
    the Show Daily Special Activity itself.
  • 0:30 - 0:32
    So here I hard wired the daily special.
  • 0:32 - 0:35
    You can make that be whatever you want.
  • 0:35 - 0:37
    This is the same code for
    putting information into the info box.
  • 0:37 - 0:40
    This is for
    the other screens like show recipe.
  • 0:40 - 0:41
    We get the TextView.
  • 0:41 - 0:43
    We set the heading.
  • 0:43 - 0:46
    And we put information into the info
    box in this case the DailySpecial.
  • 0:47 - 0:50
    And then down here, the order online,
    this is just the method
  • 0:50 - 0:55
    that gets invoked by the order
    online button, as before.
  • 0:55 - 0:58
    We just send an intent to
    start the OrderDinnerActivity.
  • 0:58 - 1:01
    Passing the dinner,
    in this case, the daily special.
  • 1:01 - 1:04
    Now moving onto the layout file for
    show daily special.
  • 1:04 - 1:06
    It's a scroll view with a linear layout.
  • 1:06 - 1:09
    It uses the info box fragment
    to display the daily special.
  • 1:10 - 1:14
    And it has a button for
    ordering online, and that's it.
Cím:
Daily Special Files - Solution
Leírás:

more » « less
Video Language:
English
Team:
Udacity
Projekt:
UD876-2 - Google Play Services - Analytics
Duration:
01:15

English subtitles

Felülvizsgálatok Compare revisions