//intent:Activity1跳轉(zhuǎn)到Activity2,并傳參數(shù)
Intent intent = new Intent();
intent.setClass(mContext, Activity2.class);
intent.putExtra("item_1", data.get(arg2).get("name")+"");
String sarr[]= {"2_選項1","2_選項2","2_選項3","2_選項4"};
intent.putExtra("sarr", sarr);
startActivity(intent);
//Activity2獲取由Activity1傳送過來的參數(shù)
Intent intent = getIntent();
String item_1 = intent.getStringExtra("item_1") + "";
String[] sarr = intent.getStringArrayExtra("sarr");
//AndroidManifest.xml中添加Activity2
網(wǎng)頁標(biāo)題:Android_Intent用于Activity間跳轉(zhuǎn)與傳值
當(dāng)前網(wǎng)址:
http://weahome.cn/article/ispjis.html