YouTube

Got a YouTube account?

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

English subtitles

← Untitled

Get Embed Code
13 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. Okay, our XML's looking pretty slick,
    but

  2. we still have to add
    the interactivity with Java.
  3. Now, using the previous
    exercises as an example,
  4. you're going to make the right
    side update for team_b.
  5. Before doing anything else you're
    going to copy and paste the code for
  6. displayForTeamB from the instructor
    notes into your own code.
  7. And you're going to update
    the text view ID for
  8. Team B to team_b_score,
    if you haven't already.
  9. I'll show you how to
    do both of these now.
  10. All right, here we are in our Java code.
  11. I've got the display for Team B code
    copied, I'm going to do this right
  12. below, not inside but below,
    the displayForTeamA and paste.
  13. To make it not inside,
  14. you want to make sure that it's
    after this bracket right here.
  15. And you know that the two curly braces
    match up because when you put your
  16. cursor next to one of the curly braces,
    the other one highlights.
  17. Okay, so
    I've pasted this code here, good.
  18. Now I need to go over to my XML code,
    get rid of the preview, okay.
  19. And I'm going to scroll down
    to this TextView here, and
  20. I actually already updated this in the
    last video, but if you need to update
  21. it, I'm going to pretend I didn't, you
    could type id and set the id attribute.
  22. And remember, you want the @+id/ and
    then you type the id that you want,
  23. in my case, I want team_b_score,
    okay, cool.
  24. Okay, and now you're pretty much
    ready to start hooking up the Java.
  25. I'm not going to give you too,
    too many instructions, but,
  26. if you're feeling like you might get
    stuck, here's some things to consider.
  27. Think about how you're
    going to associate the buttons
  28. with running some code in, Java.
  29. This was one of the first steps
    we did for the team a side.
  30. Next, consider hat new variable or
    variables you'll need.
  31. Hint, you're going to need at least one.
  32. Finally, think a little bit about
    what's going to happen when you click
  33. on each button.
  34. Now, I just want to point
    out that these steps
  35. loosely relate to the steps we
    used to make the team a side.
  36. So if you're feeling really,
    really stuck,
  37. reviewing those videos again might be
    helpful, and then, once you're done,
  38. you have the satisfaction of checking
    off this box, okay, get to it.