-2
我遇到問題,以獲得我的列表視圖上選定的數組列表項。 這裏是我的代碼:獲得在列表視圖上選擇的列表自定義對象項傳遞另一個活動?
ArrayList<Doctor> doctorList = new ArrayList<Doctor>();//this is the resources of my List.
setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, doctorList));
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
LinkedHashMap<String, Object> obj = new LinkedHashMap<String, Object>();
Doctor aDoc=(Doctor)l.getItemAtPosition(position);//this line show error
obj.put("hashmapkey", aDoc);
Intent inew = new Intent(DoctorsListActivity.this,
DoctorBioDataActivity.class);
Bundle b = new Bundle();
b.putSerializable("bundleobj", obj);
inew.putExtras(b);
startActivity(inew);
}`
* 我剛剛得到的選擇數組列表項對象通過下一個活動* 請幫助..