search

Home  >  Q&A  >  body text

android - Viewpager internal shell fragment slides horizontally. After the screen goes black, there is an overlap phenomenon when opened. There is only one fragment, which I reused. Hope God answers

 mList.clear();
            mList.addAll(impress.object.get(0).data);
            fragmentList.clear();
            for (int i = 0; i < mList.size(); i++) {
                fragmentList.add(new PageFragment(mList.get(i)));
            }
            cartAdapter.notifyDataSetChanged();

After the black screen, swipe again and there will be overlap

迷茫迷茫2743 days ago672

reply all(1)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-16 13:32:57

    @Override
    
    public void onStop() {
        ViewGroup parent = (ViewGroup) rootView.getParent();
        if (parent != null) {
            parent.removeView(rootView);
        }
        super.onStop();
    }

    This should be fine.

    reply
    0
  • Cancelreply