Create a class that extends Serializable
with getter
setter
for the List<Hashtable<String, String>> list
Custom.java
public class Custom implements Serializable{
private static final long serialVersionUID = 4466821913603037341L;
private List<Hashtable<String, String>> list;
public List<Hashtable<String, String>> getList() {
return list;
}
public void setList(List<Hashtable<String, String>> list) {
this.list = list;
}
}
To pass to next Activity.
List<Hashtable<String, String>> list = new ArrayList<Hashtable<String,String>>();
Custom custom = new Custom();
custom.setList(list);
intent.putExtra("myobj", custom);
To retrieve in next Activity
Intent intent = getIntent();
Custom custom = (Custom) intent.getSerializableExtra("myobj");
List<Hashtable<String, String>> list = custom.getList();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…