I have the following two classes.
public class People{
private int mobile_number;
private String email_id, name;
private Testimony[] testimony;
public People(String name, int mobile_number, String email_id, Testimony ... testimony) {
this.name = name;
this.mobile_number = mobile_number;
this.email_id = email_id;
this.testimony = testimony;
}
public Testimony[] getTestimony() {
return testimony;
}
public String getEmail_id() {
return email_id;
}
public int getMobile_number() {
return mobile_number;
}
public String getName() {
return name;
}
}
and
public class Testimony {
private String testimony;
private String name;
private int id;
public Testimony(String testimony,String name, int id){
this.testimony = testimony;
this.id = id;
this.name = name;
}
public String gettestimony() {
return testimony;
}
public String getname() {
return name;
}
public int getid() {
return id;
}
}
There are many objects in the ArrayList myPeople and I happen to know which ArrayList item i need to use. What can be the best way of passing a particular people object from one Activity to another considering the fact that the Testimony ArrayList has variable number of objects and sometimes can have large number of objects.
There is another question that reads similar, but it is actually different, because the other said question addresses how to pass an object to another Android Activity rather than an array of objects.