@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (mRootView == null) {
            mRootView = inflater.inflate(R.layout.frg_document, container, false);
            initView();  //初始化要放这儿
        }
        ViewGroup parent = (ViewGroup) mRootView.getParent();
        if (parent != null) {
            parent.removeView(mRootView);
        }
        return mRootView;
    }

如果你initView()方法中有列表刷新数据的方法,那么为了避免tab页切换回来时列表又重新刷新的话就按照上面的方式写就行了。

相关文章:

  • 2021-11-05
  • 2021-10-06
  • 2021-07-10
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
猜你喜欢
  • 2021-12-12
  • 2022-12-23
  • 2021-07-02
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案