wajiw
wajiw

Reputation: 12269

Access other elements during an onclick in a cursor adapter?

I have a custom cursor adapter I'm using to fill a ListView. The inflater has 2 CheckBoxes which both have onclick handlers. I want to be able to check the state of the sibling CheckBox when one is touched.

Does anyone have experience with something similar? I'm not sure how to grab the ListView row of the CheckBox and the cursor adapter is always in the state of the last row added.

Upvotes: 0

Views: 236

Answers (1)

maxpower47
maxpower47

Reputation: 1656

You could probably call getParent() on the clicked view, and then findViewById on the parent to navigate back down to the other checkbox. Of course you might have to go up a couple levels if the checkboxes are wrapped in other views.

Upvotes: 1

Related Questions