Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

onCreateContextMenu isn't being called

It looks like the onCreateContextMenu insn't being called at all. In my onCreate for my ListActivity I have:

list = getListView();
registerForContextMenu(list);

(I know it's redundant, and I've just passed getListView() with the same results).

Here is my onCreateOntextMenu;

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    Log.d("LM", "onCreateContextMenu");

    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.context_landmarks, menu);
}

The log never gets generated. Doesn't anyone have any suggestions?

like image 879
spuppett Avatar asked Jan 29 '12 21:01

spuppett


1 Answers

My thought is ListView intercepting the event and not going into contextMenu behaviour. It make sense to me because the OnItemLongClickListener behaviour overlaps contextMenu's. If not how it can recognize between contextMenu and OnItemLongClickListener?

like image 61
lulumeya Avatar answered Nov 08 '22 13:11

lulumeya