Removing fragments from an activity

后端 未结 4 1365
陌清茗
陌清茗 2021-01-30 20:54
FragmantClass rSum = new FragmantClass();
getSupportFragmentManager().beginTransaction().remove(rSum).commit();       

I am trying to remove this fragm

4条回答
  •  情话喂你
    2021-01-30 21:26

    More simple, you can replace the main content with an empty fragment, so that the main activity is viewed only.

    getFragmentManager()
    .beginTransaction()
    .replace(main_content,new Fragment())
    .commit();
    

提交回复
热议问题