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
TextViewtext to "Hello Friend"? Well, declaring the attributes inside the XML for a static
TextViewseems fine, but when we start to look at more complex View elements, we’ll need corresponding logic to control how these components work.
Main Activity in Eatery
Important views, such as the ones seen above, that you’ll see used often include:
EditTextfor inputting and editing text
Buttonand other clickable elements for supporting interactive behavior
TextViewfor displaying text
ImageViewfor 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.