Add a Button[edit source]
- In Android Studio, from the
res/layoutdirectory, edit the
- Within the
<LinearLayout>element, define a
<Button>element immediately following the
- 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.
- Define the button's text label with the
android:textattribute; set its value to the
button_sendstring resource you defined in the previous section.
<LinearLayout> should look like this: