English subtitles

← Change the TextView - Solution

Get Embed Code
13 Languages

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

  1. All right, so first we load up
    the webpage that was linked
  2. in the instructor notes.
  3. We see that it's populated
    already with some code for
  4. the Happy Birthday TextView.
  5. And then on the right,
    we see the preview and the device.
  6. To change the text that appears here,
  7. we need to change the value of
    the attribute called Android:text.
  8. So in between the quotes here
    we can change the message.
  9. Can change it to, hm,
    Happy Birthday to my pet hamster!
  10. Then on the device, we can see that
    the text has now been updated, woohoo!
  11. To change the size of the view,
    we can modify the width and
  12. height attribute values.
  13. The in between quotations,
    we can delete that and
  14. change it to something like 250dp.
  15. And then for the height we
    can change it to like 450dp.
  16. And now, we see that the text view with
    the gray background is now a lot bigger.
  17. Cool.
  18. So, the last part of the quiz
    was to try to create an error.
  19. So, if I delete the forward slash and
    the angle bracket, then,
  20. I get a bunch of errors that
    show up on the bottom, here.
  21. Also, the device greys out,
  22. because there's no valid preview
    to show on the device anymore.
  23. These errors can help you fix your code,
    and since we know what
  24. we need to do to fix it, we can just
    hit Ctrl+Z to undo the changes we made.
  25. The undo shortcut is really useful
    to use, so it's Cmd+Z on a Mac,
  26. or Ctrl+Z on a Windows.
  27. We can create other errors as well,
    such as deleting a quotation mark and
  28. we see the error down here.
  29. We can hit undo to make it come back.
  30. Or we can change darker
    grey to parker grey,
  31. which apparently Android doesn't
    recognize, unfortunately.
  32. So we can just switch it back.