Button
Android offers several types of Button
elements, including raised buttons and flat buttons as shown in the figure below. Each button has three states: normal, disabled, and pressed.

Raised button
Use the Button
element in the layout file. A raised Button
is the default style.
Flat button
Flat button borderless
Implementing click listener
Use the
findViewById()
method of theView
class to find theButton
in the XML layout file:Override the
onClick()
method:

Last updated
Was this helpful?