【发布时间】:2012-06-04 20:09:08
【问题描述】:
我想放入 Bundle 例如 Path 对象。我知道,我可以使用 putParcelable(),但是这个函数的参数应该实现 Parcelable 接口。我试图创建另一个继承 Path 并实现 Parcelable 的类,但我不知道如何实现 Parcelable 的功能。
您知道如何将 Path 对象放入 Bundle 中吗?
【问题讨论】:
标签: android path bundle parcelable
我想放入 Bundle 例如 Path 对象。我知道,我可以使用 putParcelable(),但是这个函数的参数应该实现 Parcelable 接口。我试图创建另一个继承 Path 并实现 Parcelable 的类,但我不知道如何实现 Parcelable 的功能。
您知道如何将 Path 对象放入 Bundle 中吗?
【问题讨论】:
标签: android path bundle parcelable
只需将您的课程设为extend Path 和implement serializable。然后你可以直接调用putSerializable() 传入Path 对象。
【讨论】: