I'd like to come up with a solution to the following problem:
I have a FragmentViewPager holding 4 fragments. The first one holds a Spinner with an OnItemSelected listener which gets triggered at startup (due to how spinners work). Then, if I swipe all the way to the last fragment, the first Fragment gets destroyed. After that, if I swipe this time to the first fragment, it is created again and the Spinner's OnItemSelectedListener gets triggered again, which I don't want.
How should I prevent the Spinner from triggering its listener on fragment changes from the FragmentPagerAdapter?