如何将二维阵列传递到Android中的碎片?

发布于 2025-02-03 02:34:21 字数 121 浏览 3 评论 0原文

我使用Android导航切换片段。我想传递arrayList< arraylist< myparcelable>>bundle中。我该怎么做?

I use android navigation to switch fragments. I want to pass something like ArrayList<ArrayList<MyParcelable>> within Bundle. How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光磨忆 2025-02-10 02:34:21

Bundle是一个键值存储,可容纳许多数据结构。但是,对于arrayList&lt; arrayList&lt; myparcelable&gt; gt;的特定内容,我建议将对象(JSON)序列化以用捆绑包包装,然后在另一端进行审理。

Bundle is a key-value store that accommodates many data structures out of the box. However for something as specific as ArrayList<ArrayList<MyParcelable>> I would recommend serializing the object (JSON) to package it with the Bundle, then deserializing it on the other end.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文