Last active
February 1, 2020 09:12
-
-
Save diousk/c8e8647212b82052457788951143207e to your computer and use it in GitHub Desktop.
launch fragment with fragment factory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity: FragmentInjectActivity() { | |
@Inject lateinit var fragmentFactory: FragmentFactory | |
override fun onCreate(savedInstanceState: Bundle?) { | |
supportFragmentManager.fragmentFactory = fragmentFactory | |
super.onCreate(savedInstanceState) | |
// launch fragment and add to fragmen container view | |
supportFragmentManager.beginTransaction() | |
.add<DummyFragment>(R.id.fragmentContainer) | |
.commit() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment