Android Fragments: When to use hide/show or add/remove/replace?

后端 未结 3 1819
粉色の甜心
粉色の甜心 2020-11-29 16:07

Suppose I wish to replace the current fragment in some container view with another. Is it better to use replace...

    FragmentTransaction ft = getSupportFra         


        
3条回答
  •  再見小時候
    2020-11-29 16:48

    I used hide/Show method in my activity with 4 fragments its solved my solution but some time randomly when i show my dialog it give window bad token exception when i used add and replace method then bad token exception is not occur so i think show/hide method is not perfect

提交回复
热议问题