How to add OnClickListener with databinding in recycleView buttons?
I am fetching the categories from an API and I would like to fire up a new fragment by passing the category name to retrofit on the button click. I am thinking of doing it in my UI with getText() on the button clicked and firing up the API call which will display the result on a new fragment.
The API I am using is https://fakestoreapi.com/
To my understanding, I have to handle the click events in the UI part (Fragment's Code).
The code below is in my FakeApiService.kt