1.4 Views

Wait a second, it seems like XML files give us everything we need to display an application on a screen! Did we really need that code to change the TextView text to "Hello Friend"? Well, declaring the attributes inside the XML for a static TextView seems fine, but when we start to look at more complex View elements, we’ll need corresponding logic to control how these components work.

Important views, such as the ones seen above, that you’ll see used often include:

  • (1) EditText for inputting and editing text

  • (2) Button and other clickable elements for supporting interactive behavior

  • (3) TextView for displaying text

  • (4) ImageView for displaying images

In sections 2.4 and 2.5, we will go in depth into two particular views that handle user interactions: input controls and buttons.

Last updated