android Custom Listview Background Focus State not working -


I am trying to create a custom background selector for my expandable list view. It works fine for all the states except for focus. I'm unable to identify which row is currently the code here:

im_selector.xml

  & lt; Selector xmlns: android = "http://schemas.android.com/ apk / res / android" & gt; & Lt; Android Android: state_focused = "true" android: drawable = "@ drawable / list_selector_background_focus" /> & Lt; Item Android: state_pressed = "true" android: drawable = "@ drawable / list_selector_background_pressed" /> & Lt; Items Android: Drawable = "@ Drauble / List_bg" /> & Lt; / Selector & gt;  

My list view in the layout file

  Android: ExpandableListView Android: id = "@ + ID / Android: list" Android Android: layout_height = "wrap_content" android: layout_height = "wrap_content" android: layout_weight = "1" Android: scrollbar = "horizontal" Android: layout_bello = "@ id / top_bar" Android: layout_marginbottom = "45px" Android: divider = "# 00000000 "Android: cachecolorhint =" # 00000000 "Android: list selector =" @ layout / im_selector "Android: focusable =" true "/> When you use touch mode with list view, instead of 'focus' the 'selected' attribute changes.  

'. This is why, for listing you should add this line to your selector:

  & lt; Item android: state_selected = "true" android: drawable = "@ drawable / list_selector_background_focus" />  

Comments