我怎么能把一个arraylist捆绑在一起?我用过这个,但这是错的:
Bundle bundTemasSel = new Bundle();
ArrayList<TemaRescatado> arraydirGen = dataAdapter.temaGenList;
bundTemasSel.putParcelableArray("arraySel", arraydirGen);
对象TemaRescatado有以下代码:
public class TemaRescatado {
protected String tema;
protected long id;
protected Boolean selected = false;
...
}
答案 0 :(得分:1)
TemaRescatado
必须实施Parcelable
才能putParcelableArray
所以您需要:
public class TemaRescatado implements Parcelable {
// variables
// Parcelable methods
}