【发布时间】:2018-04-02 06:09:02
【问题描述】:
我正在尝试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
关于如何处理这个问题的任何提示?
【问题讨论】: