Linux 在 putExtra 方法中发送 ArrayList<GeoPoint> 数组
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3677187/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Send ArrayList<GeoPoint> array in putExtra method
提问by Jovan
I have created Intent and I put data using putExtra
method.
我已经创建了 Intent 并使用putExtra
方法放置了数据。
Now I want to put my geoPointsArray
type variable to my intent object, here is type of geoPointsArray :
现在我想把我的geoPointsArray
类型变量放到我的意图对象中,这是 geoPointsArray 的类型:
List<GeoPoint> geoPointsArray = new ArrayList<GeoPoint>();
In existing methods putExtra
I can't find how to put my custom type.
在现有方法中,putExtra
我找不到如何放置自定义类型。
Can someone help me with this?
有人可以帮我弄这个吗?
Thanks
谢谢
回答by Pentium10
GeoPoint
must be Parcelable or Serializable. So you should subclass it to add these functionalities as I think they miss from the original implementation.
GeoPoint
必须是 Parcelable 或 Serializable。因此,您应该将其子类化以添加这些功能,因为我认为它们与原始实现相去甚远。
Then look into these other questions they will help you. Serialization issue with SortedSet, Arrays, an Serializable
然后研究这些其他问题,它们会帮助你。 SortedSet、Arrays、Serializable 的序列化问题