Translations:Android Training/Building a Simple User Interface/23/en

Aus Android Wiki
Die druckbare Version wird nicht mehr unterstützt und kann Darstellungsfehler aufweisen. Bitte aktualisiere deine Browser-Lesezeichen und verwende stattdessen die Standard-Druckfunktion des Browsers.

Add a Button

  1. In Android Studio, from the res/layout directory, edit the activity_my.xml file.
  2. Within the <LinearLayout> element, define a <Button> element immediately following the <EditText> element.
  3. Set the button's width and height attributes to "wrap_content" so the button is only as big as necessary to fit the button's text label.
  4. Define the button's text label with the android:text attribute; set its value to the button_send string resource you defined in the previous section.

Your <LinearLayout> should look like this: