こんにちは、次のように Parcelable を実装するクラスがあります。
public class adapterSource implements Parcelable {
String adiSoyadi;
String isemriTipi;
String ililce;
String mahalle;
String saat;
String durum;
private List<adapterSource> s;
public adapterSource(String adiSoyadi, String isemriTipi,String ililce, String mahalle, String saat, String durum ) {
this.adiSoyadi = adiSoyadi;
this.isemriTipi = isemriTipi;
this.ililce = ililce;
this.mahalle = mahalle;
this.saat = saat;
this.durum = durum;
}
public adapterSource(Parcel in) {
s = new ArrayList<adapterSource>();
in.readList(s, in.getClass().getClassLoader());
adiSoyadi=in.readString();
isemriTipi=in.readString();
ililce=in.readString();
mahalle=in.readString();
saat=in.readString();
durum=in.readString();
}
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel arg0, int arg1) {
}
public static final Parcelable.Creator<adapterSource> CREATOR = new Parcelable.Creator<adapterSource>() {
public adapterSource createFromParcel(Parcel in) {
return new adapterSource(in);
}
public adapterSource[] newArray(int size)
{
return new adapterSource[size];
}
};
}
そして、私はこのような1つのアクティビティでこのクラスのインスタンスを作成しようとしています:
adapterSource[] source = new adapterSource[7];
source[0] = (adapterSource) new adapterSource("isa", "isa", "asd", "asd", "asd", "asd");
source[1] = new adapterSource("isa", "isa", "asd", "asd", "asd", "asd");
source[2] = new adapterSource("isa", "isa", "asd", "asd", "asd", "asd");
source[3] = new adapterSource("isa", "isa", "asd", "asd", "asd", "asd");
source[4] = new adapterSource("isa", "isa", "asd", "asd", "asd", "asd");
source[5] = new adapterSource("isa", "isa", "asd", "asd", "asd", "asd");
source[6] = new adapterSource("isa", "isa", "asd", "asd", "asd", "asd");
Intent in = new Intent().setClass(this, MainListActivity.class);
in.putExtra("source", source);
startActivity(in);
そして、私はこのような別のアクティビティから呼び出しています:
adapterSource[] ada= (adapterSource[]) this.getIntent().getParcelableArrayExtra("source");
アンマーシャリングエラーが発生しています。何が問題ですか。助けてください...