I have a ListView and an adapter in w开发者_如何学Pythonhick I create a linear layout and return as my created element. When this linear layout is just TextViews, the context menu appears normally, When I add a checkbox to the layout, the context menu isn't shown. Is there any solution to this problem ?
The difference is that when there is a clickable element on your ListView, like a checkbox, that element handles clicks, not the ListView. Thus, you would need to add the context menu to the checkbox, not the ListView. Since a TextView is not clickable, it allows the click to pass through to the ListView.
精彩评论