The problem is this:
public void onClickDeleteButton(View view) {
int position = listView.getPositionForView(view);
listView.removeViewAt(position);
mListAdapter.notifyDataSetChanged();
}
You are removing the item from the ListView
, not from the datasource (the adapter). So, when you call notifyDataSetChanged()
the adapter attempts to refresh the data, but since nothing has changed in the data, it displays all rows again.
You should remove the item from your adapter, not from the ListView
!