Ian ft ij ui mt turn mwmrt editview iht iffiaiw mmz my um ftr t wftmfflmAfgw BtifS

F&7 EditText *fMT*h CheckBox ' tfilJIJ^iMHt, -«>H*fiHH;i&HJ;,,*JKi'i&tfi m, mjw m&mi fNfcffl^fatrttAfcJJU SfiMMif-fjffl. ft Android ftKmW -ff. fete*): XML'I'Jdi*.

tfftft main.xml ¿#4' ¡9« ft ^ ft ill'"Check Box", a«««* sir»« & kw CheckBox wmti»

<Button Android:id "8►id/check_box"

Android:layout width "wrap content" Android:layout height "wrap_content" Android:text="CheckBox" />

\ ftSMfffi

&X+ id A" check box "MM, WCheckBox private Button.OnClickListener check box button listener new Button.OnClickListener() {

public void onClick(View v) { Intent intent = new Intent ();

intent.setClass(MainActivity.this, CheckBOxActivity.class); startActivity(intent); \ );

ftlnuiTn—ff-, ft^ffift'fflftjlii«. fed) Check Box Activity, CheckBoxActivity M^ffl 3|m ^ CheckBox ffifl"-ft], fltt AIC onCreate fj&, & AM Win public void onCreate(Bundle savedlnstanceState) { super.onCreate(savedlnstanceState); setTitie("CheckBoxActivity"); setContentView(R.layout.check box); )

l.mm&W&mti check_box.xml CheckBox illft-, fWittl

<?xml version="1.0" encoding="utf-8"?>

CLinearLayout xmins : Android-"htr.p : //schemas . Android. com/apk/res/Android" Androidrorientation-"vertical" Android:layout width "fill_parent"

Android:layout hei ght - "fill parent"

<CheckBox Android: id="@^-id/plain cb" Android:text="Plain" Androi d:1a you t width-"wrap content" Android:layout_height="wrap content"

<CheckBox Android:id="§tid/serif c:b" Android:text "Seri f" Android:layout_width=-"wrap content" Android:layout_height-"wrap content" Android:typeface-"seri f"

<CheckBox Android:id-♦ id/bold cb" Android:text "Bold" Android: layout width "wrap content." Android:layout height-"wrap content" Android:textStyle="bold"

<CheckBox Android:id ^"(a + id/itaLic cb" Android:text-"Italic" Android:layout width="wrap content" Android:layout_height "wrap content" Android:textStyle-"1tal ic"

J'4t Cheek Box fflft, )t wff&mmifiimM 7-16 m in, m ® # & - k in H 4t w check box M & • t:■ ¡& # * a 11.

Button ft'M, ty-ilr Button J&iflltf, IM/fis frftW 4 -f Checkbox aiiijWtti&^W Checkbox fifrffiS

zj^ii Title ho check box.xml if'M'-WJII "t Button KM,

if] 7-16 CheckBox ^ [Til

f"7f -Android

<Button Android:id="@+id/get_view button"

Android: layout- width="wrap_content" Android:layout height="wrap content" Android: text CheckBox fate" />

private Button.OnClickListener getview button listener = new Button.OnClick Listener () (

public void onClick(View v) { String r = ""; if (plain cb.isCheckedO ) { r = r + »r" 4 plain_cb.getText(); I

ii (serif cb.isChecked()) ( r = r > ", " + serif cb.getText0; )

if (italic cb.isChecked()) { r = r i "," + italiccb.getText(); )

Checkbox Title k, 7-17 * ffl 7-17 Check8ox

RadioGroup fitittT fl1 iMtt, J&S»i^SHiW ittfcMHJifc.

ft' >ltj ifri ffy )& Ht, fifr ft main.xml A" # + ^ ill • ^ ft' ffl . rfr & ft «1 £ in' & t RadioGroupActivity, ft5fcjpJjn Button fflftPJ. AftiU Yffi^i

<Button Android:id="3 <id/radio_group_ button"

Android:layout_width^"wrapcontent" Android: layout_height. "wrap_content" Android:text="RadioGroup" />

t id % "radio group button" fftft'M, # & £ it .g /]< 3t T % " RadioGroup

private Button .OnClickListener radio group but toril istener new Button. OnClickListener{) {

public void onClick(View v) { Intent intent = new Intent 0;

intent.setClass(MainActivity.this, RadioGroupActivity.class); startActivity(intent); ) \;

Chpcked .nafe.loM

0 0

Post a comment