Adding multiple instances of the same fragment

前端 未结 1 1825
刺人心
刺人心 2021-01-23 04:53

I am attempting to add multiple instances of the same fragment to an activity. Example code is

    FragmentManager fm = getSupportFragmentManager();
    Fragmen         


        
1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-23 05:13

    The problem seemed to be is using the FrameLayout as the container for the fragments. I change this to

    
    

    and it now works fine.

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