Bad Parcelable исключение
прежде всего я должен сказать, что яЯ искал ответ на мою проблему здесь, на этом сайте, и я нашел несколько тем, касающихся этого исключения, но после всех тем не былотак сильно мне помочьпочему яя публикую это.
получаю исключение Bad Parcelable каждый раз, когда я пытаюсь восстановить информацию из посылки. Вот'мой код класса.}
public class Persona implements Parcelable {
private String nombre,email,tel;
public Persona() {
nombre = "";
email = "";
tel = "";
}
public Persona(String nombre, String email, String tel) {
this.nombre = nombre;
this.email = email;
this.tel = tel;
}
public Persona(Parcel p){
setNombre(p.readString());
setEmail(p.readString());
setTel(p.readString());
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
@Override
public String toString() {
return this.getNombre() + " " + this.getEmail() + " " + this.getTel();
}
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel des, int flags) {
des.writeString(getNombre());
des.writeString(getEmail());
des.writeString(getTel());
}
public static final Parcelable.Creator creator = new Creator() {
public Persona createFromParcel(Parcel source) {
return new Persona(source);
}
public Persona[] newArray(int size) {
return new Persona[size];
}
};
И мой код активности (эта операция возвращает намерение, содержащее ArrayList только что указанного типа)}
public class Contacts extends Activity {
private ArrayAdapter names;
private Intent intent;
private ArrayListnameList;
private ListView list;
public Contacts() {
intent = new Intent();
nameList = new ArrayList();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.contacts);
setIntent(getIntent());
iterateContacts();
names = new ArrayAdapter(this, android.R.layout.simple_list_item_1, getNameList());
getList().setAdapter(getNames());
}
public void iterateContacts(){
ArrayList aux = GetIntent().getParcelableArrayListExtra("contactList");
for(int i = 0; i