I have an adapter with a button inside and I don't really know ho to do something when I presse the button. It's an order app and in the the basket I have a delete button to delete a dish. Do you have a solution ?
Asked
Active
Viewed 110 times
2 Answers
0
Maybe you can find the solution here: https://stackoverflow.com/a/37846430/
Instead of implementing the View.OnClickListener
in the ExampleClickViewHolder
, you should be fine with simply setting an onClickListener
to your button and call the mOnEntryClickListener.onEntryClick
in it.
For a more reliable answer, please add some details on your current code.

nf3lix
- 58
- 4
-
j'avais déjà regardé et j'utilise binding car notre prof le veut mais c'est bon j'ai mis le clic dans l'adapter le soucis que j'ai c'est actualiser l'adapter – lerey Feb 09 '22 at 19:07
0
So I put the code of the button in the adapter and I put in it ""list.removeAt(position) notifyDataSetChanged()""

Super Kai - Kazuya Ito
- 22,221
- 10
- 124
- 129

lerey
- 39
- 6