路过的ArrayList&LT;为MyObject&GT;多个活动之间 [英] Passing ArrayList<MyObject> Between multiple Activities
问题描述
我试图通过多种活动之间的对象一个ArrayList在我的应用程序。是否有可能使用使用setData()方法的意图,做到这一点?
I am trying to pass an ArrayList of Objects between multiple activities in my application. Is it possible to do this using an Intent using the setData() method?
推荐答案
如果您要发送对象的ArrayList那么你的类必须实现的 Parcelable 或序列化接口。
If you want to send an ArrayList of objects then your class must implement the Parcelable or Serializable interface .
发送活动之间的自定义对象看到这些好的教程
See these good tutorials for sending custom object between Activities
的http://androidideasblog.blogspot.in/2010/02/passing-list-of-objects-between.html
<一个href="http://www.anddev.org/novice-tutorials-f8/simple-tutorial-passing-arraylist-across-activities-t9996.html" rel="nofollow">http://www.anddev.org/novice-tutorials-f8/simple-tutorial-passing-arraylist-across-activities-t9996.html
这篇关于路过的ArrayList&LT;为MyObject&GT;多个活动之间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!