package Ġcom . and rew cw ang . jw ta uth . ui . extensions Ċ Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġcom . and rew cw ang . jw ta uth . R Ċ Ċ // ĠNOTE Ġfor Ġchanging Ġfragments : Ġhttps :// stackoverflow . com / a / 5 5 8 8 6 7 7 1 Ċ // ĠI 've Ġchanged Ġthis Ġsince ĠI Ġonly Ġhave Ġone Ġframe Ġwhich Ġis ĠR . id . root _ layout Ċ Ċ fun ĠAppCompatActivity . add Fragment ( fragment : ĠFragment ){ ĊĠĠĠ Ġsupport FragmentManager . do Transaction Ġ{ Ġadd ( R . id . root _ layout , Ġfragment ) Ġ} Ċ } ĊĊ Ċ fun ĠAppCompatActivity . replace Fragment ( fragment : ĠFragment ) Ġ{ ĊĠĠĠ Ġsupport FragmentManager . do Transaction { Ġreplace ( R . id . root _ layout , Ġfragment ) Ġ} Ċ } Ċ Ċ fun ĠAppCompatActivity . remove Fragment ( fragment : ĠFragment ) Ġ{ ĊĠĠĠ Ġsupport FragmentManager . do Transaction { Ġremove ( fragment ) Ġ} Ċ }