Last active
June 21, 2020 17:44
-
-
Save Zhuinden/a814fb8c7fa16b338cef473bd25da8db to your computer and use it in GitHub Desktop.
Hilt MainActivity
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
@AndroidEntryPoint | |
class MainActivity : AppCompatActivity() { | |
@Inject | |
lateinit var navigationDispatcher: NavigationDispatcher | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
navigationDispatcher.navigationCommands.observe(this) { command -> | |
command.invoke(Navigation.findNavController(this, R.id.nav_host)) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment