Created
March 23, 2021 06:51
-
-
Save manuelvicnt/2f1d6f3d8ef6398390331c4838c431d2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 LocationFragment: Fragment() { | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
// ... | |
viewLifecycleOwner.addRepeatingJob(Lifecycle.State.STARTED) { | |
locationProvider.locationFlow().collect { | |
// New location! Update the map | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment