I got a FragmentPagerAdapter. It\'s getItem
method can return a fragment according to data it has from the outside. After I update the data its suppose to display I
none of the solutions given above works for me. So hope below solution may be helpful for you.
In my code, I have 2 Fragments in viewPager. One is used for 3 EditTexts and 1 button and another fragment has RecyclerView. On button click, my value is going to recyclerView, but it's not updating. So now, I used the below code:
I called the notifyDataSetChanged() on button click. My MainActivity has inner adapter class extends FragmentStatePagerAdapter class. So i called it using mainActivity.mMainAdapter.notifyDataSetChanged(). Hope it helps someone.