Home | History | Annotate | Download | only in widget

Lines Matching defs:Button

30  * <p>To display a button in an activity, add a button to the activity's layout XML file:</p>
33 * &lt;Button
39 * <p>To specify an action when the button is pressed, set a click
40 * listener on the button object in the corresponding activity code:</p>
49 * final Button button = findViewById(R.id.button_id);
50 * button.setOnClickListener(new View.OnClickListener() {
52 * // Code here executes on main thread after user presses button
59 * the listener to the button using
62 * user presses the button.</p>
71 * <p>Every button is styled using the system's default button background, which is often
73 * default button style, you can customize it. For more details and code samples, see the
74 * <a href="{@docRoot}guide/topics/ui/controls/button.html#Style">Styling Your Button</a>
77 * <p>For all XML style attributes available on Button see
78 * {@link android.R.styleable#Button Button Attributes},
85 public class Button extends TextView {
88 * Simple constructor to use when creating a button from code.
90 * @param context The Context the Button is running in, through which it can
93 * @see #Button(Context, AttributeSet)
95 public Button(Context context) {
100 * {@link LayoutInflater} calls this constructor when inflating a Button from XML.
105 * You typically do not call this constructor to create your own button instance in code.
111 * @param attrs The attributes of the XML Button tag being used to inflate the view.
113 * @see #Button(Context, AttributeSet, int)
116 public Button(Context context, AttributeSet attrs) {
121 * This constructor allows a Button subclass to use its own class-specific base style from a
125 * <p>For Button's base view attributes see
126 * {@link android.R.styleable#Button Button Attributes},
130 * @param context The Context the Button is running in, through which it can
132 * @param attrs The attributes of the XML Button tag that is inflating the view.
135 * attribute values serve as default values for the button. Set this parameter
137 * @see #Button(Context, AttributeSet, int, int)
140 public Button(Context context, AttributeSet attrs, int defStyleAttr) {
145 * This constructor allows a Button subclass to use its own class-specific base style from
150 * @param context The Context the Button is running in, through which it can
152 * @param attrs The attributes of the XML Button tag that is inflating the view.
155 * attribute values serve as default values for the button. Set this parameter
158 * supplies default values for the button, used only if
162 * @see #Button(Context, AttributeSet, int)
165 public Button(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
171 return Button.class.getName();