通过意向对象的数组列表 [英] Array List of objects via intent
本文介绍了通过意向对象的数组列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道你可以通过意图传递String数组列表,但如果这是我定义的一些对象的数组列表?说Bicyles数组列表中,我该怎么办呢?
I know you can pass in an array list of String via intent, but what if it's an array list of some object that I defined? Say an array list of Bicyles, how do I do this?
推荐答案
您可以让你的对象实现Parcelable,并使用 putParcelableArrayListExtra
。或者,你可以以某种方式序列化对象,并把你的序列化对象的字节数组。
You can make your objects implement Parcelable and use putParcelableArrayListExtra
. Alternatively, you can serialize your objects in some way and put the byte array of your serialized objects.
这篇关于通过意向对象的数组列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文