blackcj / DesignSupportExample

Example project using the Android Design Support Library.
60 stars 21 forks source link

SwipeRefreshLayout not work after change screen orientation #1

Open i-petro opened 9 years ago

i-petro commented 9 years ago

Amazing support library example, but SwipeRefreshLayout do not work after change screen orientation to landscape. Please, fix it

snapcatcher commented 8 years ago

Hi, i faced the same issue and fixed it by changing:

PageFragment pageFragment = mAdapter.getFragment(mViewPager.getCurrentItem());

in MainActivity on line 116 to:

PageFragment pageFragment = (PageFragment) getSupportFragmentManager().findFragmentByTag(
                                                "android:switcher:" + R.id.viewPager + ":" + mViewPager.getCurrentItem());