creating parcelable in android from some of the fields of a class

后端 未结 2 1971
情歌与酒
情歌与酒 2021-01-27 19:26

i have the following class which i intent to pass from one activity to another:

public class Ad extends ListItem implements parcelable{
    private String _type;         


        
2条回答
  •  春和景丽
    2021-01-27 20:16

    It's your code that writes to Parcel and your code that reads from Parcel. So basically yes. You can write whatever you want. Content of all members, content of some, no members, but other values you use to restore state of the object etc, etc.

提交回复
热议问题