0

My app has a sliding tabs setup, and each tab is a Fragment handled by an extension of FragmentPagerAdapter. I'm looking for a way to set a value associated with each fragment, while being sure that I can access those values regardless of whether or not the fragment has been destroyed. One way I've thought of is to put a simple array in the code for either the adapter or the activity, but I couldn't figure out how to access each fragment's position from within the fragment itself.

Noah Andrews
  • 353
  • 2
  • 14
  • Pass in the position when you create the fragment... [Navigation Drawer](https://developer.android.com/training/implementing-navigation/nav-drawer.html) is a good example. – tachyonflux Mar 10 '15 at 00:14
  • Of course, I knew I had to be missing something really obvious like that. Thanks! – Noah Andrews Mar 10 '15 at 00:51

0 Answers0