首页 > 代码库 > Android Bug 汇总

Android Bug 汇总

1 问题:

         FragmentStatePagerAdapter+viewpager第二次进入该fragment不显示数据

    解决方法:

         在含有ViewPager的Fragment的onCreateView方法中添加代码:

                

                    if (view != null) {

                     ViewGroup parent = (ViewGroup) view.getParent();

                     if (parent != null) {

                     parent.removeView(view);

                     }

                     return view;

                     }