Info

7-45 Bundle SfflfEIS

ralntent.putExtras(bundle); set-Result (RESULT OK, mlntent) ; finish () ; )

• Bundle bundle = new Bundle()i£&iftfiJ'ti, MJ^SIT—t Bundle i1 4; Intent ftjj&JB.

• bundle.putString("store", "ftftj*i'J Activity P)i?i<iJ, & String bundle 'K

• mlntent.putExtras(bundle)tni»J^i Bundle /SWJlJ Intent ^ + o

• RESULTOK. ffJfc^Wfistiil-: *. $ :-t#ttSMI*SjB|n|»illffljlt Activity ^Intent.

Flfiiif ■ F ActivityMain S'l'M onActivityResultO^fifco A onClick()^f&4', SRHJT^^WA" Intent, fe^ji^. ti^J^c Intent W) Activity jSNffl, BBfiWrW Activity ft if 5c J§ ffi ft if IBM Activity 3 + m^m^^o tM«®«CiJtJ6 onActivityResuIUint requestCode, int resultCode. Intent data)o

• requestCode : i^tMiJ&J& Intent ^ 11■' ffl requestCode, M in , /£ tf ^ + £ REQUEST CODE.

• resultCode: Activity Vil^J^&if'&feiHWo jWS"—WISfeitfiftlKl. »4«teHfijiflt£ 0, Android ^fe

«wffi, mssmniw^isriLiwii, wft^afi/T-i'MfhTft^MssTo

• Intent: ^mf Activity J?f Activity ft if ^JSiSlEl»^ Intent, M^WUM Intent ^»fORM Activity ftif^JnWiSMifio «¿SttniGUijl extras.getString()#&;$iy• startActivityForResult()*ll onActivityResult()nJgJllftWJfcJfe—*li>i-#MiffiiSiflffl. J&ftT&jSHiai

/{•: Activity «fWiflffllH Service M^St* onActivityResultO'KftiWiP F/?f>f<:

3Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_C0DE) ( if (resultCode == RESULT CANCELED) setTitle ("HX./8") ;

else if (resultCode == RESULT OK) { String temp=null;

Bundle extras = data.get-Extras () ; if (extras != null) ( temp = extras.getString("store"); )

setTitle(temp);

• W^^l^if<JrequestCodeiitijM4«]Wibi,IU , frtt f :!i * H JtJ f fl T requestCodc.

• ttiflWUM resultCodc »iT^Mfttii, /hi^M f M' fi WW resultCode, xti resultCode -RESULT_CANCELED WMiftflUff^tt T: ^ resultCodc = RESULT OK, iM WiE'M', "J iittrT -iPMitJS.

M/n# F AndroidManilest.xml iff", ^SrtfJ Activity Mi,

|<activity Android:name-".Activityl"></activity> <activiLy Android:name=".Activity2"></act ivity>

^ AndroidManifcst.xml X#> Android &ftiftiiifhxfr

; il^h Activity, M JL^F Servicc, % Jl^ ContentProvider, a£ *S Wiftii^ IntentFilter | Intent

ffi^jWrt^S'i'ftfne^'S) vmvm, ummmmft, m Button.Textview

tfj^o jgfflmjfln, Button mil* ^ Button munm&mA ■

Activity iS^ffifii^MSirii-^ List View, (HJ6

j'Mflltt/iJ List View;

List Activity; fWf\\W\i ListAdapter; JTJ Array Adapter List View iiifj JfJ Simple Adapter ListView iit t J

ListView lMM'1 : iflM4fcfl!i£# ListView

0 0

Post a comment