I have a recyclerview. With on item click on the recyclervie, which I have done in the adapter as viewholder on click listener, will go to a separate activity for result and will return an object to the activity with the recyclerview. How can I update the clicked item on the recyclerview with the updated one from activity result?
Asked
Active
Viewed 69 times
1
-
you have to use notify on data set change in adapter during onActivityResult – DeePanShu Feb 05 '19 at 07:24
1 Answers
0
After closing the second activity you need to update the dataset, used by RecyclerView and its adapter. Do it in the onActivityResult() method of the first activity. Then call notifyDataSetChanged() or better notifyItemChanged(int position) to redraw the changed element.

Змей Горыныч
- 89
- 1
- 4