problem description
if the onResume event of the second page is triggered when the first page is opened, the onResume of the third page will trigger the fragment. The life cycle of the fragment is onAttach ()-> onCreate ()-> onCreateView ()-> onActivityCreated ()-> onStart ()-> should not be triggered when the status of the future should be displayed?
the environmental background of the problems and what methods you have tried
I guess maybe the way viewpager displays fragment is to display three at the same time to prevent stutters when you open the next page.
related codes
/ / Please paste the code text below (do not replace the code with pictures)
ViewPager viewPager = findViewById (R.id.viewPager);
viewPager.setCurrentItem (2);
what result do you expect? What is the error message actually seen?
is there a way to trigger the onResume event only when a page is opened?