Skip to content

Instantly share code, notes, and snippets.

@Kaspic
Last active March 4, 2021 20:38
Show Gist options
  • Save Kaspic/8289568c178c250d1ac5feb4cc370266 to your computer and use it in GitHub Desktop.
Save Kaspic/8289568c178c250d1ac5feb4cc370266 to your computer and use it in GitHub Desktop.
class TestFragment : Fragment(R.layout.fragment_test) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
if (savedInstanceState == null) {
childFragmentManager.commit { replace(R.id.fragmentContainerView, SubTestFragment(), SubTestFragment::class.java.canonicalName) }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment