Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kirich1409/c4f2b831882686f5937b306d2b445f8e to your computer and use it in GitHub Desktop.
Save kirich1409/c4f2b831882686f5937b306d2b445f8e to your computer and use it in GitHub Desktop.
class SetFragmentFactoryActivityCallback(
private val newFragmentFactory: FragmentFactory
) : EmptyActivityLifecycleCallbacks {
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
if (activity is FragmentActivity) {
activity.supportFragmentManager.fragmentFactory = newFragmentFactory
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment