How to keep only one instance of a fragment, when switching with NavigationDrawer?

后端 未结 4 406

My App starts with a AddressFragment. From the NavigationDrawer I start (amongst others) a new AddressFragment with:

getSupportFragmentManag         


        
4条回答
  •  独厮守ぢ
    2020-12-05 16:06

    First time you create the fragment with a tag.

    When you want to replace it try to get the fragment with tag and if it return null you create a new one

提交回复
热议问题