‫Welcome back.
‫I'm proud of you guys because you created this amazing application reviewing the recycler view and the
‫card views.
‫Now let's handle the click events on these card views.
‫Go to the Sports Adapter class and go to the View Holder class.
‫And inside this init block I need to handle the click events on the items of this recycler view item
‫view dot set on click listener and inside this click listener, I need to specify what we need to do
‫when the user clicks on the items of the cart.
‫View toast dot make text I need to display a toast message.
‫The first parameter is item view dot context.
‫I'm getting the context.
‫The second parameter is the message you clicked.
‫And here I'm going to get the clicked item title.
‫So from the sports list go and get the current position which is the adapter position.
‫If we go up in the adapter position and we need to get the sport name, the third parameter is the length.
‫So toast dot length short and don't miss to add the show method.
‫Okay, so I'm getting from the sports list that it is past.
‫I'm getting the current clicked adapter position and we are getting the sports name.
‫Run the application.
‫And here if I click football you clicked football basketball tennis and volleyball.
‫So congratulations guys.
‫We succeeded in handling the click events on card views.