Basically, I am creating a messaging app. So, I created a RecyclerView in which an ArrayList of Objects(Mobile Numbers) are stored. On clicking on any of the objects, opens the layout that shows all the messages sent by the clicked Mobile number. That’s why I am trying to figure out how to access the object that has been clicked.
Haven’t tried anything yet. Still trying to figure out what to do.
2
Answers
Here is the code.
Let me know if you have any problems in understanding the code.
Do it in a efficient way.
First create a interface and declare it in your adapter class..
Than on onBindViewHolder call it.
Now from your activity where you called the adapter implement the interface, after implement you can easily override this onClick method there.