ProgrammerGuide.Net | Step by Step Programmer Guide

Adding a Button | Android Programming | ProgrammerGuide.Net | Step by Step Guide

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.

Please click here for related products on Amazon!

Jayashee

Add comment

Want to Check Celebrities News?