Intent and Parcelable object Android

前端 未结 5 691
刺人心
刺人心 2021-02-09 07:44

Why do I need to parcel my object even if I just need to send it to another thread of the same task? Actually I need to open an activity that will run even on the same thread (t

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-09 07:58

    In order to pass your custom class object(s) between Activities/Services/etc. using Bundle within Intent, your class must need to implement Parcelable or Serializable.

    That's the reason you need to parcel your object before pushing into Bundle

提交回复
热议问题