我的自定义项目中有BaseAdapter
类。现在我有, 并且两个图像按钮(编辑和删除)在我的行中。当我从 GetView() 中删除查询并调用但那里没有发生任何事情时。请看下面的代码:ListView
ListView
TextView
listView
notifyDataSetChanged();
public View getView(final int position, View 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()
不工作......请任何人告诉我我在哪里犯了错误?