我正在尝试将一个数据类进行Parcelize
。
它包含一个参数:
var tokenType: Any? = null
对于这个变量,编译器在编译时会抱怨:
Type is not directly supported by Parcelize.
Annotate the parameter with @RawValue if you want it to be serialized via
writeValue()
虽然这个错误本身很容易理解,但当我像这样添加@RawValue时:
@RawValue var tokenType: Any? = null
它报错:
This annotation is not applicable to the target value parameter
你有什么方法可以处理这个问题吗?
KotLang
的帖子中添加一个链接,以帮助其他人获得更多的上下文信息。 - KE Keronei