@Override public Object instantiateItem(ViewGroup container, int position) { WindFragment fragment = (WindFragment) super.instantiateItem(container, position); int day = Util.calculateDay(new Date()); // today mFragments.put(new Integer(position), fragment); return fragment; }
@Override public Fragment getItem(int position) { WindFragment fragment = mFragments.get(new Integer(position)); if (fragment == null) { int day = Util.calculateDay(new Date()); // today fragment = WindFragment.newInstance(mWindSpots.get(position % mWindSpots.size()), day); mFragments.put(new Integer(position), fragment); } return fragment; }