This question has already been answered:

I have a ListView with my own adapter. In the markup there is a checkbox, whose state you need to change when you click on the list item in which it is located. Everything would be fine, but both the adapter and the model are in separate classes, since the ListView itself is initialized in a separate Activity .

Is it possible to accomplish this?

Reported as a duplicate by pavlofff members, Community Spirit 5 May '16 at 3:01 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • one
    This question is already more than chewed up completely - pavlofff
  • @pavlofff, if I duplicate the rules for this answer? ru.stackoverflow.com/a/464885/17609 - YurySPb
  • @pavlofff, OK, otherwise I’m on the android now the golden Hummer double and I’m always afraid not to put up a duplicate) - Yuriy Spb
  • Well, actually, this answer has everything for the full implementation of checkboxes, if something from this answer is not clear, indicate in your question and attach the code that you have already written to solve (or create :)) this problem. - pavlofff
  • @pavlofff, that's it, I find the checkbox in the listener's parent view and have already done everything myself) there is only one problem. checkboxes change screen after screening and return - Flippy

1 answer 1

For such things, there is an interface .

Here is an example of how to use it.