我有一个CustomAddress类扩展了android.location.Address实现的类Parcelable。
我正在尝试使我的CustomAddress实现Parcelable,但在从包裹创建我的课程时被卡住了。从宗地创建时,我想要CustomAddress首先填写超类中的所有字段Address,然后填写我自己的字段。所以我已经实现了这个CREATOR领域:
public static final Parcelable.Creator<CustomAddress> CREATOR
= new Parcelable.Creator<CustomAddress>() {
public CustomAddress createFromParcel(Parcel in) {
return new CustomAddress(in);
}
public CustomAddress[] newArray(int size) {
return new CustomAddress[size];
}
};
但是在我的CustomAddress(Parcel in)创建者中,我不能调用super(in),因为它不存在于android.location.Address. 我只能访问android.location.Address.CREATOR. 那么如何使用 填写我的字段CREATOR?
编辑:链接到 androidAddress类https://developer.android.com/reference/android/location/Address.html