I am utilizing the follow class, which I have as an object: http://pastebin.com/rKmtbDgF
And I am trying to pass it across using:
Intent booklist = new I
Easiest Way to do this is to implement Serializeable ..
import java.io.Serializable;
@SuppressWarnings("serial")
public class Student implements Serializable {
public Student(int age, String name){
this.age = age;
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
private int age;
private String name;
}
Sending object from Activity A to Activity B
Student student = new Student (18,"Zar E Ahmer");
Intent i = new Intent(this, B.class);
i.putExtra("studentObject", student);
startActivity(i);
Getting Object in Activity B.
Intent i = getIntent();
Student student = (Student)i.getSerializableExtra("studentObject");