首页 新闻 会员 周边

android 中 intent 传参问题

0
悬赏园豆:5 [已关闭问题] 关闭于 2012-07-08 06:23

a activity 中传参(这两句代码在gridView的onitemclick事件中)

Intent intent = new Intent(ImageViewjita.this, Kecheng.class);
intent.putExtra("id", jitake[position]);//jitake是int数组,元素均为R.drawable.XXX

 

b activity 中接收

第一种方法

kechengid = keint.getIntExtra("id",R.drawable.jitabut);‘

第二种方法  

Intent keint = new Intent();
Bundle buntwo = keint.getExtras();
int kechengid = buntwo.getInt("id");

 

无法正确接收,全是null。。。。。。。不知道什么原因····

android  初学,有劳大家··

东宫有喜的主页 东宫有喜 | 初学一级 | 园豆:3
提问于:2012-07-08 02:00
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册