摘要:
1.Arrayprivate ArrayList<String> checkList=new ArrayList<String>(); Intent intent=new Intent(mytext.this,show.class); intent.putStringArrayListExtra("list", checkList); startActivity(intent); 调用 Intent intent=this.getIntent(); ArrayList<String> list=intent.getStringArrayL 阅读全文
随笔档案-2012年3月29日
Intent传递对象的两种方法(Serializable,Parcelable)
2012-03-29 10:53 by omgee, 518 阅读, 收藏,
摘要:
今天讲一下Android中Intent中如何传递对象,就我目前所知道的有两种方法,一种是Bundle.putSerializable(Key,Object);另一种是Bundle.putParcelable(Key, Object);当然这些Object是有一定的条件的,前者是实现了Serializable接口,而后者是实现了Parcelable接口第一步:新建一个Android工程命名为IntentDemo第二步:修改main.xml布局文件java代码 <?xml version="1.0" encoding="utf-8"?> < 阅读全文
浙公网安备 33010602011771号