Search code examples
androidandroid-fragments

Replace the <fragment> tag with FragmentContainerView


Android Studio offers to replace a <fragment> tag in Google Maps fragment. In an application I don't have Navigation, but probably will add. Should I replace the <fragment> tag with <FragmentContainerView>?

enter image description here

Looking at https://proandroiddev.com/android-fragments-fragmentcontainerview-292f393f9ccf I found that we can also replace <FrameLayout> with <androidx.fragment.app.FragmentContainerView>. Should we do so?


Solution

  • <FragmentContainerView... is meant to replace both <FrameLayout... and <Fragment... Refer to this answer on a similar question.

    Answer on the benefit of using <FragmentContainerView