摘要:
转载自:http://www.cnblogs.com/GoAhead/archive/2012/07/16/2593868.html大家好,好久不见,今天要给大家讲一下Android中Intent中如何传递对象,就我目前所知道的有两种方法,一种是 Bundle.putSerializable(Key,Object);另一种是Bundle.putParcelable(Key, Object);当然这些Object是有一定的条件的,前者是实现了Serializable接口,而后者是实现了Parcelable接口,为了让大家更容易理解我还是照常写了一个简单的Demo,大家就一步一步跟我来吧!第一步: 阅读全文
posted @ 2013-11-04 20:52
aparche
阅读(637)
评论(0)
推荐(0)
摘要:
要求:页面1跳转到页面2,页面2再返回页面1同时返回数据页面1添加如下代码: Intent intent = new Intent(); intent.setClass(页面1.this, 页面2.class); Bundle bundle = new Bundle(); intent.putExtras(bundle);//将Bundle添加到Intent,也可以在Bundle中添加相应数据传递给下个页面,例如:bundle.putString("abc", "bbb"); startActivityForResult(intent, 0);// 跳转 阅读全文
posted @ 2013-11-04 20:38
aparche
阅读(19049)
评论(2)
推荐(0)
浙公网安备 33010602011771号