title: Why are all fragments affected when data is updated by using viewpager2?
body: <p>I'm using viewpager 2 now.</p>
  <p>The views of the fragments are all the same, so I'm using the same fragments.</p>
  <p>And the data is shown through recyclerview in the fragment.</p>
  <p>All fragments set different data list.</p>
  <p>OnResume retrieves new data through a network call and performs recyclerviewAdapter.submitlist.</p>
  <p>It shows the same data view during swiping.</p>
  <p>If onResume does not update the data, it shows a different view during swiping.</p>
  <pre><code>class CommunityViewPagerAdapter(
      fragmentManager: FragmentManager,
      lifecycle: Lifecycle,
  ) : FragmentStateAdapter(fragmentManager, lifecycle) {
  
      private val fragments = listOf(
          TechCommunityFragment.newInstance(&quot;Backend&quot;),
          TechCommunityFragment.newInstance(&quot;Frontend&quot;),
          TechCommunityFragment.newInstance(&quot;Android&quot;),
          TechCommunityFragment.newInstance(&quot;IOS&quot;),
          TechCommunityFragment.newInstance(&quot;DataScience&quot;),
          TechCommunityFragment.newInstance(&quot;DataAnalysis&quot;),
          TechCommunityFragment.newInstance(&quot;Algorithm&quot;),
          TechCommunityFragment.newInstance(&quot;DataStructure&quot;),
          TechCommunityFragment.newInstance(&quot;Network&quot;),
          TechCommunityFragment.newInstance(&quot;OperatingSystem&quot;),
      )
  
      override fun getItemCount(): Int {
          return fragments.size
      }
  
      override fun createFragment(position: Int): Fragment {
          return fragments[position]
      }
  
  }
  </code></pre>
  <pre><code> private fun initView() = with(binding) {
  
          viewPager.adapter= CommunityViewPagerAdapter(childFragmentManager, lifecycle)
  
          TabLayoutMediator(techTablayout, viewPager) { tab, position -&gt;
              tab.text = mainTabArray[position]
          }.attach()
      }
  </code></pre>
  <pre><code> override fun onResume() {
          super.onResume()
          techStack = arguments?.getString(TECH_STACK) ?: &quot;&quot;
          callAPI()
      }
  </code></pre>