Button
ToggleButton
CheckButton primavera
RadioButton primavera
ImageButton
<Button android:id="@+id/bt_ok"
android:text="@string/ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClickOK"/>
void setOnClickListener([Link] listener)
[Link]( new [Link]()
{
public void onClick(View view)
{
}
}
);
void
setText(CharSequence
text)
<ImageButton android:id="@+id/ib_1"
android:src="@android:drawable/sym_def_app_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
void
setImageBitmap(Bitmap
bitmap)
void
setImageResource(int
resourceId)
void
setImageDrawable(Drawable
drawable)
void
setImageURI(Uri
uri)
void
setOnClickListener([Link]
listener)
[Link]( new [Link]()
{
public void onClick(View view)
{
}
}
);
<ToogleButton android:id="@+id/tb_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:textOff="@android:string/capital_off"
android:textOn="@android:string/capital_on" />
void setTextOn(CharSequence textOn)
void setTextOff(CharSequence textOff)
void toggle()
void
setChecked
(boolean
checked)
/
boolean
isChecked()
void
setOnCheckedChangeListener([Link]
listener)
[Link](new [Link]()
{
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
:::
}
}
);
<CheckBox android:id="@+id/cb_spring"
android:text="@string/spring_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"/>
void setText(CharSequence text)
void
setChecked
(boolean
checked)
boolean
isCheck()
void
setOnCheckedChangeListener([Link]
listener)
[Link](new [Link]()
{
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
:::
}
}
);
<RadioGroup android:id="@+id/rg_seasons"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RadioButton android:id="@+id/rb_spring"
android:text="@string/spring"
android:checked="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
:::
</RadioGroup>
void check(int checkedId)
int
getCheckedId()
void
clearCheck()
void
setOnCheckedChangeListener([Link]
listener)
[Link](new [Link]()
{
@Override
public void onCheckedChanged(RadioGroup group, int checkedId)
{
}
}
);
void setText(CharSequence text)
void
setChecked
(boolean
checked)
boolean
isCheck()
void
setOnCheckedChangeListener([Link]
listener)
[Link](new [Link]()
{
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
:::
}
}
);