Info

il'^jS Dialog?

^«^L-f ^Iffflft ViewSBJIiL#Ajava.lang.Object ffi&ftlfeffl ft. £ ft i Activity, Dialog Mii^lKl, £ ft 19 4 Activity

Activity

Ef-Sot'ontfjiiaC*

• showDialog(int id), ftt&^f*«^ id (fy Dialog. StBMftillJftiWJnfi. faWII Dialog fftM onCreatcDialog(int id)*

• dismissDialog(int id), t£faUK>J id tfj Dialog A:Vf ifil 'i'l'tfl A.

Dialog onCreateDialog(int id)#1 onPrepareDialog(int id, Dialog dialog)^»» "Wl: Activity ^»I'iHffl 7 showDialog(int id)/i7, ftll-ift&t Dialog tt&ftiflffl Dialog WHiH«» onCreateDialog(int id), onPrepareDialog(int id, Dialog dialog): (01 ifciS'h Dialog 1M^iii^SfiM^M1. fc, onCreateDialogflnt id), ilBJS fiM»] iffl onPrepareDialog(int id. Dialog dialog).//¡¿o onPreparcDialog(int id, Dialog dialog) Jj Ji-Jgift jf J&fif- W >li Dialog '-feriUMJte

Dialog «ft -fSfciS. Dialog teBlJtff«

i'M f Dialog ^J-^W^illiiUu , ^fl ActivityMain ifl-M' onCreate() //& V.J&ttY&M

Button buttonl = (Button) tindViewByld(R.id.button1); buttonl.setOnCiickListener(new OnClickListener() { public void onClick(View v) ( showDialog(DIALOG!); I

• findViewByld id j&H&^fflftff^lfflo

• setOnCiickListener JjiJk^J buttonl Sf f t-i' «IflkW8» .

• onClick()>j 'T'-iti Button Jg'ft M ffiefi ft 0

• showDialog()X/ Activity <Jl id %) DIALOGI ft Dialog )fco

IMr showDialog(DIALOGl)ft&9J5, ^SEIMf luJ iflHfift onCreateDialog(), ill h

@Override protected Dialog onCreateDialog(int id) { switch (id) ( case DIALOGI:

return buildDialogl{ActivityMain.this) ; case DIAL0G2:

return buildDialog2(ActivityMain.this); case DIAL0G3:

return buildDialog3(ActivityMain.this); case DIAL0G4:

return buildDialog4(Act ivityMain.this) ; )

return null; )

immm:

• buildDialogl m^^f&M "t*®M/j^J Dialog.

Was this article helpful?

0 0

Post a comment