Detecting which selected item (in a ListView) spawned the ContextMenu (Android)

后端 未结 8 815
难免孤独
难免孤独 2020-11-27 12:27

I have a ListView that will allow the user to long-press an item to get a context menu. The problem I\'m having is in determining which ListItem they long-press

8条回答
  •  执念已碎
    2020-11-27 12:43

    And don't forget to put this

    registerForContextMenu(listview);
    

    in your onCreate method to get your context Menu visible.

提交回复
热议问题