我有一个返回ArrayList
父活动的子活动
儿童活动
ArrayList<Users> selectedMembers = new ArrayList<Users>();
//And then
Intent returnIntent = new Intent();
returnIntent.putExtra("ArrayOfUsers",selectedMembers);
setResult(RESULT_OK,returnIntent);
finish();
家长活动
现在如何ArrayList<Users>
在父 Activity 上获得这个
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data){
if (resultCode == RESULT_OK) {
//how to get ArrayList<Users> here
}
}
我做了这样的事情,但我给出了错误
selectedMembers.addAll((data.getParcelableArrayListExtra("ArrayOfUsers"));
错误:
The method addAll(Collection<? extends Users>) in the type ArrayList<Users> is not applicable for the arguments (ArrayList<Parcelable>)