mixing of items of viewpager2 inside recycler view

I want to show multiple image posts like in Instagram, so i used ViewPager2 for posts, and placed it in a PostAdapter. Now, the first two posts show the same picture. When I scroll, it fixes itself and shows the correct images. Restarting the app breaks it again, and the first two images are the same, and again get fixed when the user scrolls.

I used holder.setIsRecyclable(false) in both adapter’s bind view holder.

Screenshot of the app showing the broken behavior. In that screenshot, the first two posts show the same image, even though they’re supposed to be different.

Asked on July 16, 2020 in Java.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.