作者:Shellycs68 | 来源:互联网 | 2023-05-25 11:04
1> Blackbelt..:
notifyDataSetChanged
不是的方法ListAdapter
,但BaseAdapter
,(ArrayAdapter是BaseAdapter的子类).要解决此问题,您只需转换ListAdapter即可
theListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View view, int position, long id) {
String s1 = String.valueOf(parent.getItemAtPosition(position));
pe.remove(s1);
((BaseAdapter)theAdapter).notifyDataSetChanged();