如何使用内部其他自定义对象的 LinkedList 序列化/反序列化 Android 中的对象?
如何在android中序列化/反序列化对象并包含其中的其他对象列表?我使用 sqlite 手动保存所有字段并保存在列表中的另一个表对象中,但我很好奇是否有更简单的方法。
How to serialize/deserialize object in android with list of other objects inside ? I done this with sqlite to manually save all fields and in another table objects from list but I am curious is there any easier method.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
序列化/反序列化对象的一种相当简单的方法是使用 JSON 和包装器,例如 Google Gson< /a> 这将为您解决所有艰苦的工作。
您还没有提到序列化/反序列化这些嵌套对象的目的,但 Gson 会给您一个漂亮的小(json 可解析)文本文件,供您随意处理。
A fairly easy way to serialize/deserialize an object would be to use JSON and a wrapper like Google Gson that will take care of all the hard work for you.
You haven't mentioned the purpose of serializing/deserializing these nested objects, but Gson will give you a nice little (json parseable) text file to do with as you please.