首先要继承OnItemLongClickListener

public class Set_Music extends ListActivity implements OnItemLongClickListener{

然后设置权限:

getListView().setOnItemLongClickListener(this);

重写方法

public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {

String str = list.get(arg2).get("name");

删掉长按的item
list.remove(arg2);

动态更新listview
adapter.notifyDataSetChanged();

相关文章:

  • 2022-12-23
  • 2021-04-26
  • 2022-12-23
  • 2021-05-18
  • 2021-11-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2021-06-28
  • 2021-04-18
相关资源
相似解决方案