且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

列表视图中删除项,刷新 - 机器人

更新时间:2023-02-02 23:33:24

您可能得到它解决,但为了以防万一别人有同样的问题,这是我的解决方法:

You probably got it solved but just in case anyone else has the same Problem, here is my Solution:

ArrayAdapter<String> myAdapter = (ArrayAdapter<String>)getListView().getAdapter();
myAdapter.remove(myAdapter.getItem(info.position));
myAdapter.notifyDataSetChanged();

但问题是,你没有你的列表中选择适配器。

The Problem was that you did not have the Adapter of your List.