Android Kotlin create class implement Parcelable give an error in 'override' of writeToParcel method

前端 未结 2 666
走了就别回头了
走了就别回头了 2020-12-31 07:29

To use Parcelable, I had followed this release of Kotlin 1.1.4 : https://blog.jetbrains.com/kotlin/2017/08/kotlin-1-1-4-is-out/

Add this line in project



        
2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 08:10

    Make sure you are using the kotlin 1.1.4 version

    No need to override the writeToParcel/createFromParcel methods. Unless you doing any specific things.The studio gives you error but you can ignore this error; the lint checks haven’t yet been updated to understand @Parcelize. The corresponding YouTrack issue is here:

    https://youtrack.jetbrains.com/issue/KT-19300

    To use create class

    Then to pass it like

    To get it back

提交回复
热议问题