Is there any way to get an item of the RecyclerView at a particular position outside the adapter. e.g in ListView we could do:
listView.getItem(position);
Can we do this with RecyclerView ? and also is the order of provided data list maintained ?
Best Solution
You can add your own method to
RecyclerView
or I would suggest theRecyclerView.Adapter
itself.For instance, for ListView, you have:
You can add the same thing to your
RecylcerView.Adapter
or access it another way by adding a simple method to yourRecylcerView.Adapter
:Use it like this: