I have a recyclerview that its data come from viewModel and database using retrofit. I know how to update all data of recyclerview every time that I want. but when I go to the selected item page using navigation component with selected item data as its argument, I don't know how to update data of this page (using e.g. swiperefresh).
I can update all data, that its output is a List
, but I don't know how to find the selected item among the list. It is easy in Array
case using index
but here it is a List. Any simple solution?
here are some related posts but I couldn't use them: