0

In my Android application I have used a Listview and in each element in the listview have two checkboxes. The problem is, the user can not select those checkboxes using the device trackball. It highlights the entire element when move to select the checkbox with the device trackball and do not let the user to select one of the checkboxes that resides in an element in the list view.

If touch screen moving the finger and click the checkbox is posible. But how can I Let it to be done using the device trackball to move and click the required checkbox.

If someone can help me to achieve this its a great help.....Thanks in Advance...!!!

Edits... Or is this imposible to do so, to work with trackball?????

JibW
  • 4,538
  • 17
  • 66
  • 101
  • Did you try rolling the trackball towards the right/left when a row is highlighted? – Akshay Aug 16 '11 at 14:30
  • Yes Tried, But no difference......!!! Still do not select any checkbox. Highlights the entire Listview element and thats it. – JibW Aug 16 '11 at 14:33

2 Answers2

1

Did you call listView.setItemsCanFocus(true)?

dmon
  • 30,048
  • 8
  • 87
  • 96
  • Thanks dmon. It works... I was searching for this by changing listview properties for a long time... Thanks once again.....!!!! – JibW Aug 17 '11 at 06:09
0

I have successfully implemented your requirement by setting focusable to false.

<CheckBox
            android:id="@+id/checkBox"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_gravity="center_vertical"
            android:focusable="false"
            />

Try it.

Akshay
  • 5,747
  • 3
  • 23
  • 35
  • Hi Akshay, Still it highlights and selects the entire row when trying to select any checkbox by using the device trackball. I cant select any single checkbox using device trackball(Right/Left/up/Down arrow keys and select button). – JibW Aug 16 '11 at 14:48