我在我的自定義ListView
項目中有BaseAdapter
類ListView
。現在我有TextView
,拖曳圖像按鈕(編輯和刪除)在我的listView
行。當我火災刪除查詢從GetView()並呼籲notifyDataSetChanged();
但沒有發生那裏。請參見下面的代碼:BaseAdapter NotifyDatasetChanged()getView()不工作
公共查看getView(最終詮釋的立場,觀點convertView,ViewGroup中parentView){
ViewHolder holder ;
holder = new ViewHolder();
convertView = mInflater.inflate(R.layout.local_jobs_list_row , null);
holder.job_name = (TextView) convertView.findViewById(R.id.txt_job_name);
holder.img_edit = (ImageButton) convertView.findViewById(R.id.icon_edit_job);
holder.img_delete = (ImageButton) convertView.findViewById(R.id.icon_delete_job);
convertView.setTag(holder);
holder.img_delete.setTag(itemDetailsrrayList.get(position).getLocal_job_id());
holder.img_delete.setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View v) {
db.open();
db.deleteLocalJob(String.valueOf(v.getTag()));
db.close();
notifyDataSetChanged();
}
});
holder.job_name.setText(itemDetailsrrayList.get(position).getLocal_job_name());
return convertView;
}
這裏notifyDatasetChanged()
無法正常工作......請有人告訴我在哪裏,我想提出mistack ?
非常感謝你@Brijesh – user2507920