Android: Context menu on single click

前端 未结 4 795
借酒劲吻你
借酒劲吻你 2020-12-28 14:51

I have an Intent that extends a ListActivity. In my onCreate method after having populated the list adapter I use registerForContextMenu(getListView());

4条回答
  •  渐次进展
    2020-12-28 15:48

    I don't think it's working smoothly. Calling openContextMenu(l) will cause item.getMenuInfo() to be null (inside method onContextItemSelected(MenuItem item)).

    You should call l.showContextMenuForChild(v) instead of openContextMenu(l).

提交回复
热议问题