I\'ve implemented my class with serializable, but it still didn\'t work.
This is my class:
package com.ursabyte.thumbnail;
import java.io.Serializab
Don't forget to implement Serializable in every class your object will use like a list of objects. Else your app will crash.
Example:
public class City implements Serializable {
private List house;
public List getHouse() {
return house;
}
public void setHouse(List house) {
this.house = house;
}}
Then House needs to implements Serializable as so :
public class House implements Serializable {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}}
Then you can use:
Bundle bundle = new Bundle();
bundle.putSerializable("city", city);
intent.putExtras(bundle);
And retreive it with:
Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();
City city = (City)bundle.getSerializable("city");