如何实现长按item批量选择删除listview
1个回答
展开全部
lv.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView arg0, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub
//System.out.println(arg0.getItemAtPosition(arg2).toString());
arg0.removeViewInLayout(arg1);
return false;
}
});
@Override
public boolean onItemLongClick(AdapterView arg0, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub
//System.out.println(arg0.getItemAtPosition(arg2).toString());
arg0.removeViewInLayout(arg1);
return false;
}
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询