Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class MyFragment: Fragment() {
override fun onViewCreated(view: View, state: Bundle?) {
super.onViewCreated(view, savedInstanceState)
viewLifecycleOwner.lifecycleScope.launch {
// do-some ui work
init {
// some helpful f()s have been
// provided such as launchWhenStarted.
// E.g.We can fragment transaction after onStart etc.
lifecycleScope.launchWhenStarted {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment