I have faced one strange issue :
My listview rows were not selecting through Bluetooth keyboard
Tryed to select rows through Bluetooth keyboard arrow keys but no row getting focus.
Solution 1 : Initially tried android:focusable="true" and it is getting focus for each row but click funtionlity of that row is not working.
Solution 2 : Tried following tag and everything works perfectly.
android:descendantFocusability="blocksDescendants".
android:descendantFocusability
Defines the relationship between the ViewGroup and its descendants when looking for a View to take focus.Must be one of the following constant values.
| Constant | Value | Description |
|---|---|---|
| afterDescendants | 1 | The ViewGroup will get focus only if none of its descendants want it. |
| beforeDescendants | 0 | The ViewGroup will get focus before any of its descendants. |
| blocksDescendants | 2 | The ViewGroup will block its descendants from receiving focus. |

No comments:
Post a Comment