[英]How to transfer an ArrayList of objects from one Activity to another
I have an ArrayList of objects in one activity and I need this arrayList in another activity.我在一个活动中有一个 ArrayList 的对象,我在另一个活动中需要这个 arrayList。
Is there a solution to transger this ArrayList?这个ArrayList有没有解决办法? I know i can use intents for ArrayList of Strings but what's about the ArrayList of objects?
我知道我可以对 ArrayList 的字符串使用 intents,但是 ArrayList 的对象呢?
Thank you.谢谢你。
Complex types passed by means of Parcelable
or do the serialization
to another kind of primitive object that you can put to Intent's extras.通过
Parcelable
传递的复杂类型或对另一种原始类型 object 进行serialization
,您可以将其放入 Intent 的 extras。 see this question:看到这个问题:
Help with passing ArrayList and parcelable Activity 帮助传递 ArrayList 和 parcelable Activity
and this tutorial:和本教程:
Passing a list of objects between Activities 在 Activity 之间传递对象列表
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.