我想发送ArrayList包含getter setter类对象。但我面临的错误如下:
The method putParcelableArrayListExtra(String, ArrayList<? extends Parcelable>) in the type Intent is not applicable for the arguments (String, ArrayList<BloodDonor>)
//调用新活动
ArrayList<BloodDonor> bloodDonors = filterData(selectedCountry, selectedState, selectedCity, selectedZip, selectedbloodgroup);
Intent intent = new Intent(getActivity(), DonerListActivity.class);
intent.putParcelableArrayListExtra("bloodDonorList", bloodDonors);
startActivity(intent);
// filterData()
方法的声明。
private ArrayList<BloodDonor> filterData(String SelectedCountry,
String selectedState, String selectedCity, String selectedZip,
String bloodgroup) {
ArrayList<BloodDonor> bloodDonor = new ArrayList<BloodDonor>();
Log.d("DB", "values in filter" + SelectedCountry + selectedState
+ selectedCity + selectedZip);
DatabaseHelperDao helperDao = new DatabaseHelperDao(getActivity());
try {
helperDao.open();
bloodDonor = helperDao.fatchDoner(SelectedCountry,
selectedState, selectedCity, selectedZip, bloodgroup);
} catch (Exception e) {
e.getStackTrace();
} finally {
helperDao.close();
}
return bloodDonor;
}
dao method fetchdonor()
返回捐赠者列表。
请帮帮我。谢谢