Why is item.getMenuInfo() null?

后端 未结 3 1323
梦如初夏
梦如初夏 2021-01-24 21:38

Within my ListVeiw item I have 4-8 ImageView(some of them are invisible depended of some value) and 4 TextView.

When I Long click to item of Listview the (AdapterContext

3条回答
  •  暖寄归人
    2021-01-24 22:07

    You need to register the list for context menu, not the items.

    // wrong:
    activity.registerForContextMenu(vi);
    
    // right:
    activity.registerForContextMenu(myList);
    

提交回复
热议问题