Android: Making a class parcelable

后端 未结 5 907
无人及你
无人及你 2020-12-15 06:32

I want to pass on object between two activities in Android which has lead me to parcelable classes. I am not trying to convert my current class but don\'t understand the Par

5条回答
  •  悲哀的现实
    2020-12-15 07:06

    Transferring data between activities can be done using serializable as well as Parcelable. But parcelable is considered best.(why)

    There is a plugin in android that lets you insert parcelable code for fields in the class. You can find it from menu File > Settings > Plugins > Android parcelable code generator.

    And use the shortcut alt + insert just like getter and setter to use the plugin.

提交回复
热议问题