Button represents a push-button widget. Push-buttons can be
pressed, or clicked, by the user to perform an action. A typical use of a
push-button in an activity would be the following:
public class MyActivity extends Activity {
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.content_layout_id);
final Button button = (Button) findViewById(R.id.button_id);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click
}
});
}
}
XML attributes
See {@link android.R.styleable#Button Button Attributes},
{@link android.R.styleable#TextView TextView Attributes},
{@link android.R.styleable#View View Attributes}
|