我定义了一个按钮,点击按钮然后弹出对话框,当点击确定时,就删除选中条目,但是获取不了选中项的id,所以一直报空指向,怎么解决
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
if (gridView.getVisibility() == View.GONE) {
selectitems = listView.getCheckedItemPositions();
} else {
selectitems = gridView.getCheckedItemPositions();
}
return true;
}