Setonitemclicklistener Event Doesn't Work In Fragment
I am trying to get onItemClick on ListItems to work from a fragment. Here is my code: public class MyBudgetPageMenuFragment extends Fragment { private Context context; private Lis
Solution 1:
Note that the ListView blocks clicks of an item that contains at least one focusable descendant but it doesn’t make the content focus-reachable calling setItemsCanFocus(true). One workaround is by disabling focusability of descendants, using
android:descendantFocusability="blocksDescendants"
in the layout defining your list item. (First learned of this myself from http://cyrilmottier.com/2011/11/23/listview-tips-tricks-4-add-several-clickable-areas/) Does your layout contain buttons? If so, you'd fall into this case.
Post a Comment for "Setonitemclicklistener Event Doesn't Work In Fragment"