Time for action - asking a question

In order to ask our user a question, you will need to add a TextView to the top of your layout. A TextView is a bit like a Label or JLabel. It's also the base class for many other Android View widgets that display text. We want it to take up all of the available horizontal space, but only enough vertical space for our question to fit. We populate the TextView with Please wait... as its default text. Later, on we will replace this with a dynamically selected question.

  1. Go back to your main.xml file.
  2. Between the<LinearLayout...> and</LinearLayout> create a<TextView /> element, ending it with the empty element /> syntax since elements representing View objects are not allowed to have child elements.
  3. Give the TextView ...

Get Android User Interface Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.