如何設置選定的長按項目? 這不工作(項目單擊時沒有保持選中):在longClick上設置選擇?
listView.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view,
int position, long id) {
listView.setSelection(position);
return true;
}
});
setLongClickable(true)? http://stackoverflow.com/questions/5855541/items-in-listview-not-long-clickable-after-setting-click-listener-in-getview –