Created
January 30, 2021 17:24
-
-
Save GauravChaddha1996/d0a82bae4d3076c55e17a8173e74374e to your computer and use it in GitHub Desktop.
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 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