http://blog.csdn.net/gk969/article/details/40262149
文中返回有些问题
改正:把值传给上层并返回
public voidonClick(View view) {
Intent intent =newIntent();
Bundle bundle =newBundle();
bundle.putParcelableArrayList("reslist",resList);
intent.putExtras(bundle);
setResult(RESULT_OK,intent);
finish();
}
在上一个Activity接收返回的模型对象列表
protected voidonActivityResult(intrequestCode,intresultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch(resultCode) {//根据状态码,处理返回结果
caseRESULT_OK:
Bundle bundle =data.getExtras();//获取intent里面的bundle对象
ArrayList resultList = bundle.getParcelableArrayList("reslist");
break;
default:
break;
}
}