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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 23:24:21  来源:igfitidea点击:

Send ArrayList<GeoPoint> array in putExtra method

android

提问by Jovan

I have created Intent and I put data using putExtramethod.

我已经创建了 Intent 并使用putExtra方法放置了数据。

Now I want to put my geoPointsArraytype variable to my intent object, here is type of geoPointsArray :

现在我想把我的geoPointsArray类型变量放到我的意图对象中,这是 geoPointsArray 的类型:

List<GeoPoint> geoPointsArray = new ArrayList<GeoPoint>();

In existing methods putExtraI can't find how to put my custom type.

在现有方法中,putExtra我找不到如何放置自定义类型。

Can someone help me with this?

有人可以帮我弄这个吗?

Thanks

谢谢

回答by Pentium10

GeoPointmust 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 的序列化问题