Created
October 11, 2019 12:46
-
-
Save ininmm/3b5b44903c187d81a04fcb3988f81170 to your computer and use it in GitHub Desktop.
Allowing the fragment to use NavigationUI methods without crashing.
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
val scenario = launchFragmentInContainer { | |
TitleScreen().also { fragment -> | |
fragment.viewLifecycleOwnerLiveData.observeForever { viewLifecycleOwner -> | |
if (viewLifecycleOwner != null) { | |
Navigation.setViewNavController( | |
fragment.requireView(), | |
mockNavController | |
) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment