首先要继承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();