android - 使 String 之类的类可打包?

标签 android kotlin parcelable

有什么方法可以使最终/封闭类可打包?例如。 StringZonedDateTime(来自 java.time)。

最佳答案

Is there any way to make a final/closed class parcelable?

不,对不起。

E.g. String or ZonedDateTime(from java.time).

Android 已经可以将 String 放入 Parcel 中,因此没有必要以某种方式使其成为 Parcelable

此外,请记住自定义 Parcelablecannot be used in all cases .今天早上我不得不处理这个特殊问题。

关于android - 使 String 之类的类可打包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61462263/

相关文章:

android - 动态调整textview的字体大小

android - 使用自定义可打包类解码 Android 应用程序中的错误

android - com.android.support :appcompat-v7 and design version 23. 2.0 崩溃包裹错误

java - 包含其自身的 ArrayList 的 Parcelable

android - 设置 calendar.DAY_OF_MONTH 时出现问题

android - 如何使用 Indy HTTP Get 命令正确终止线程?

android - 从模型通知适配器

android-studio - Kotlin AddOnPageChangeListener 不起作用

bash - 在 kotlin 脚本 [.kts] 中解压缩文件

android - 如何为需要电影列表的 RecyclerView.Adapter 提供数据?