Android中如何从一个Activity中ArrayList<HashMap<String,Object>>传递到另一个activity?
存:intent.putExtra("arrayList", dataList);
取:
ArrayList<HashMap<String, Object>> dataList = new ArrayList<HashMap<String, Object>>();
dataList = ( ArrayList<HashMap<String, Object>>) getIntent().getSerializableExtra("arrayList");
·intent.putExtra()存
·intent.getSerializableExtra()取
·取的时候记得强制类型转换
如:
存:intent.putExtra("arrayList", dataList);
取:
ArrayList<HashMap<String, Object>> dataList = new ArrayList<HashMap<String, Object>>();
dataList = ( ArrayList<HashMap<String, Object>>) getIntent().getSerializableExtra("arrayList");