0

I am trying to implement a Custom adapter for ListView where I have two TextViews and a ToggleButton. Before the togglebutton I was able to use setOnItemLongClickListener which I can not now and I know that focus is on togglebutton so is the issue. However I want two operation work simultaneously so I have tried to use:

 android:longClickable="true"
 android:descendantFocusability="blocksDescendants" 

Then I tried to use

listView1.setLongClickable(true);

Tried to return true in onItemLongClick

However, these things are not working. How can I handle this?

halfer
  • 19,824
  • 17
  • 99
  • 186
Saty
  • 2,563
  • 3
  • 37
  • 88

1 Answers1

1

Give this Attribute to Adapter Layout

android:descendantFocusability="blocksDescendants" 
Android Developer
  • 987
  • 1
  • 8
  • 22