Home » Android » How to add set button in a populateViewHolder?

How to add set button in a populateViewHolder?

Posted by: admin November 1, 2017 Leave a comment

Questions:

Im having a problem when i added in a Button in the pouplateViewHolder and it has no mistakes, but when i pressed on it, it wont show anything, and it doesnt response. Can anyone please help me, im stucked at this part and stressed of it. Im using android studio and this is inside a recycler view. When i keep pressing the btn, it wont show anything to me, and the database is not updated too.

This is the XML file. Please help 🙁

Answers:

The button should be initialized in viewholder if that is an instance in your recyclerview. Hope the following code will solve your problem.