Rafael Muhamedzyanov Rafael Muhamedzyanov - 1 year ago 276
Android Question

How to get item from RecyclerView adapter in Android

In old code when I was using ListView with custom adapter I could get item with this code.

Message msg = (Message) adapter.getItem(poistion);

Now I am implementing RecyclerView. How can I get item from RecyclerView adapter?

Answer Source

You have to implement it yourself.

Add a new method in your custom Adapter and you are done.

public Message getItem(int position) {
  return messageList.get(position);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download