ViewPager2 does not refresh the Fragment View while using FragmentStateAdapter

Viewed 344

I am using viewPager2 and this is my dependency implementation "androidx.viewpager2:viewpager2:1.0.0"

But I wont able to update my fragment view while using notifyDataSetChanged()

I wanted to update a button view of my fragment. I tried to update manually but wont be success.

if (item is CategoryProduct) {
                if (this::addBtn.isInitialized) {
                    addBtn.setProductQuantity(item.quantity.toLong())
                }
            }

But when I swipe the viewPager I am getting isInitialized false for that particular view , If I have not scrolled its working properly please help me in this.

Please help me if any one can.

0 Answers
Related