Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开发者设置打开不保留活动,在使用了这个SlidingTabLayout的activity当中,按后台键,再切换回前台,出问题了。 #226

Open
fuckjm opened this issue Sep 22, 2017 · 1 comment

Comments

@fuckjm
Copy link

fuckjm commented Sep 22, 2017

开发者设置打开不保留活动,在使用了这个SlidingTabLayout的activity当中,按后台键,再切换回前台,出问题了。SlidingTabLayout滑动出现异常,viewPager滑动出现异常,而我换回support包的TabLayout的话,完全没问题

@zdxiang
Copy link

zdxiang commented Sep 22, 2017

已经解决。请查看自己是否已经调用了一次mViewPager.setAdapter(xxxxxx),再调用tabLayout.setViewPager(xxxxx),如果是这样的话,就会导致上述问题。看了源码之后,里面有个内置的Adapter的,所以只需要调用tabLayout.setViewPager(xxx)即可,
e.g: tabLayout.setViewPager(mViewPager, titles.toArray(new String[titles.size()]), ((BaseActivity) (mContext)), (ArrayList) fragments);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants