AppCache icon indicating copy to clipboard operation
AppCache copied to clipboard

问下为啥实体类需要序列化,为啥需要Serializable,不能用Parcelable么?

Open sxf-Ignite opened this issue 6 years ago • 3 comments

sxf-Ignite avatar Aug 28 '18 03:08 sxf-Ignite

这要看 这个对象使用的场景

在 2018年8月28日,11:26,Begonia [email protected] 写道:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

lawdao avatar Aug 30 '18 06:08 lawdao

能具体说一下么?

sxf-Ignite avatar Aug 31 '18 01:08 sxf-Ignite

Parcelable不能使用在要将数据存储在磁盘上的情况,因为Parcelable不能很好的保证数据的持续性在外界有变化的情况下。尽管Serializable效率低点,但此时还是建议使用Serializable

sovwcwsfm avatar Oct 08 '18 02:10 sovwcwsfm