@Override public void onAttach(Context context) { super.onAttach(context); try { timeTableDataContext = (IGetTimeTableData) context; } catch (ClassCastException e) { throw new ClassCastException(context.toString() + " must implement IGetCourseData"); } mSectionsPagerAdapter = new SectionsPagerAdapter(); }
@Override public void onDestroyView() { super.onDestroyView(); Activity context = getActivity(); if (context != null) { subscriber.unsubscribe(); if (!context.isFinishing()) ((GetStorage) context) .storage() .put(TimetableDataFragment.LAST_PAGE, mViewPager.getCurrentItem()); } }