Android fragments overlap

前端 未结 1 471
滥情空心
滥情空心 2021-01-29 00:35

I have an activity with two fragments, one to display a list and one to show the details of the clicked item. When starting the app the detail part is something static, once I c

1条回答
  •  醉话见心
    2021-01-29 00:55

    Instead of using in layout xml fragment:

    
    
    
    

    Use some container like LinearLayout or FrameLayout with some containerId. Then programatically firstly add fragment to this container using containerId, and after that replace content of this container with containerId also.

    0 讨论(0)
提交回复
热议问题