I can't transfer an object from one activity to another
<p>I want to send an object from one Details Activity to Persons Activity. I followed the tutorials but I get the following error:</p>

<pre><code>12-19 08:19:00.434: E/AndroidRuntime(1011): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.workingonlist/com.example.workingonlist.Persons}: android.os.BadParcelableException: Parcelable protocol requires a Parcelable.Creator object called  CREATOR on class com.example.workingonlist.Person
</code></pre>

<p>Here is the Person model:</p>

<pre><code>public class Person implements Parcelable {

    private String name;
    private String surname;
    private String gender;

    public Person() {
        // TODO Auto-generated constructor stub
    }

    public Person(Parcel in){
        name= in.readString();
        surname= in.readString();
        gender= in.readString();
    }

    public Person(String name,String surname,String gender){
        this.name=name;
        this.surname=surname;
        this.gender=gender;
    }

        // getters and setters

    @Override
    public int describeContents() {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeString(surname);
        dest.writeString(gender);   
    }

    private Parcelable.Creator&lt;Person&gt; CREATOR = new Parcelable.Creator&lt;Person&gt;() {

        @Override
        public Person createFromParcel(Parcel source) {
            // TODO Auto-generated method stub
            return new Person(source);
        }

        @Override
        public Person[] newArray(int size) {
            // TODO Auto-generated method stub
            return new Person[size];
        }

    };
}
</code></pre>

<p>This is Details Activity which I want to send Person object.</p>

<pre><code>private View.OnClickListener onClick = new View.OnClickListener() {

    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        if(v.getId()==btn_save.getId()){
            Person p = new Person();
            p.setName(et_name.getText().toString());
            p.setSurname(et_surname.getText().toString());


            switch(rg.getCheckedRadioButtonId()){
                case  R.id.button1:{
                    p.setGender("Male");
                    break;
                }
                case R.id.button2:{
                    p.setGender("Female");
                    break;
                }
            }

            Intent i = new Intent(Details.this,Persons.class);
            i.putExtra("person",p);  
            startActivity(i);
        }
    }
};
</code></pre>

<p>And here is the Persons Activity which I want to get Person object.</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    PersonAdapter adapter = new PersonAdapter();

    setContentView(R.layout.persons);
    Bundle b = getIntent().getExtras();
    if (b != null) {
        Person p = b.getParcelable("person");
        adapter.add(p);
    }

    setListAdapter(adapter);
}
</code></pre>

<p>What can I do in order to solve this problem ? Any help is appreciated.Thanks in advance.</p>
