Search code examples
androidlistviewcontextmenutogglebutton

Context menu and ToggleButton in ListView row


I have got a ListView, whose a TextView a ToogleButton. Now I have to implement a context menu for my ListView. But if the toggle buttons are visible, context menu won't show up. onListItemClick doesn't work, either. Why? enter image description here


Solution

  • @ChiragRaval, I have found the solution.

    android:focusable="false" for the ToggleButton is what I need. Now both the ToggleButtons and the context menu work.