startactivityforresult(intent intent, int requestcode)注意要返回的是當前的介面下乙個介面的資料,onactivityresult(int requestcode, int resultcode, intent intent)
setresut(int resultcode, intent intent)
注意比如在忘記密碼的操作時,往往會有有好幾個介面,這裡要把資料連續傳下去,否則會報錯
a - -- > b ---- c
c -----a 這時就為空了(要把資料傳到b-->a)
intent bundle 傳輸資料
intent intent = new intent();
bundle bundle = new bundle();
bundle.putstring(config.model_id, modelid);
bundle.putstring(config.qiniu_key, pickey);
intent.putextras(bundle);
或是
bundle bundle = new bundle();
bundle.putstring("phoneno", "12345");
sendsmsactivity.this.setresult(result_canceled,sendsmsactivity.this.getintent().putextras(bundle));
sendsmsactivity.this.finish();
接收資料
bundle bundle = getintent().getextras();
bundle.getint(config.design_type, 1);
......
Intent 傳遞資料
intent 可傳遞的資料型別 可傳輸的資料型別 a.基本資料型別 陣列 b.string 陣列 c.bundle map d.serializable bean e.parcelable 放在記憶體乙個共享空間裡 基本型別 intent intent new intent this,otherac...
Intent資料傳遞
1 首先是activity的簡單跳 activity的切換一般是通過intent來實現的,intent是乙個activity到達另乙個activity的引路者,它描述了起點 當前activity 和終點 目標activity 乙個簡單intent實現如下 intent intent new inte...
Intent資料傳遞
1 首先是activity的簡單跳 activity的切換一般是通過intent來實現的,intent是乙個activity到達另乙個activity的引路者,它描述了起點 當前activity 和終點 目標activity 乙個簡單intent實現如下 intent intent new inte...