Search code examples
androidandroid-recyclerviewadapter

Adapter Android Studio Button


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 ?


Solution

  • 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.