Intent附加数据的两种写法
摘要:
第一种写法,用于批量添加数据到Intent:Intent intent =new Intent();Bundle bundle =new Bundle();//该类用作携带数据bundle.putString("name", "林计钦");intent.putExtras(bundle);//为意图追加额外的数据,意图原来已经具有的数据不会丢失,但key同名的数据会被替换 第二种写法:这种写法的作用等价于上面的写法,只不过这种写法是把数据一个个地添加进Intent,这种写法使用起来比较方便,而且只需要编写少量的代码。Intent intent =new 阅读全文
posted @ 2013-10-14 18:12 &大飞 阅读(218) 评论(0) 推荐(0)
浙公网安备 33010602011771号