Previous fragment visible under the new fragment

后端 未结 7 1380
心在旅途
心在旅途 2021-02-05 04:10

I have a tab + ViewPager layout and in one of these tabs I have a list view. When I replace that list fragment upon the onclick I can still see the old fragment u

7条回答
  •  礼貌的吻别
    2021-02-05 04:26

    Instead of R.id.container put id of fragment like this: ((ViewGroup)getView().getParent()).getId(). Actually it is not replacing the fragment but the previous layout i.e FrameLayout. It works for me and i hope it will work in your case also.

提交回复
热议问题