0

how can I manage focus of textview like checkbox focus is managed in listview(if i click on check box in listitem only checkbox is clicked and if i click on listitem checkbox is not clicked). what I tried is:

  • textview focusable true. but listitem is then not clickable
  • textview focusableInTouchMode true. but listitem is then not clickable
iBug
  • 2,334
  • 3
  • 32
  • 65

1 Answers1

1

You may use selectors for highlight view in list.

Or if you need something more difficult(Behavior of TextView must do the same work like CheckBox) then you have two ways for resolve that

1) Use CheckBox view with param

android:button="@null"
android:background="@drawable/my_custom_selector_for_state"

2) "remember" background color of your TextView in item object after click and set in getView(...) method in adapter

Community
  • 1
  • 1
Stanislav
  • 405
  • 2
  • 11