Adding a Button | Android Programming

Button is a view object that can be added to the layout. Below is a sample code that represent a button in a layout.

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/button_send"/>

The height and width of the button layout are set to wrap_content to fit the button's text. The button's text will be retrieved from the string resource by button_send.