1
我在android中有一個listactivity。上下文菜單打開時,我按下我的列表視圖的項目。上下文菜單android
當我關閉這個上下文菜單,然後我回到按同一項目(其它項目都沒有問題)
如果我按到文本出現的問題,上下文菜單不公開,但如果我按白色區域,然後出現contextmenu。
¿什麼問題?
onCreate方法:
lv = getListView();
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
TextView text = (TextView) view.findViewById(R.id.label);
if (!text.getTag().toString().equals("-1"))
{
registerForContextMenu(text);
openContextMenu(text);
}
}
});