@Override protected void onDetachedFromWindow() { // modified by maddog05 if (mViewPager != null) mViewPager.removeOnPageChangeListener(this); // finish modified super.onDetachedFromWindow(); }
@Override public void onPause() { mViewPager.removeOnPageChangeListener(mOnPageChangeListener); mViewPager.removeOnAdapterChangeListener(mOnAdapterChangeListener); LocalBroadcastManager.getInstance(this).unregisterReceiver(mResultsReceiver); super.onPause(); }
@Override protected void onDestroy() { super.onDestroy(); mViewPager.removeOnPageChangeListener(mViewPagerOnPageChangeListener); }