Slide 18
Slide 18 text
FragmentFactory
class SampleFactory: FragmentFactory() {
override fun instantiate(
classLoader: ClassLoader,
className: String
): Fragment {
return when (className) {
SampleFragment::class.java.name -> SampleFragment("ABC")
else -> super.instantiate(classLoader, className)
}
}
}