Is it possible to initiate outside of a composable...
# compose
y
Is it possible to initiate outside of a composable function? I use my navController on
onNewIntent()
of my activity but it can sometimes throw a null exception due to it not being initiated yet.
I initiate it on my activity's
Copy code
setContent { }
but it looks like
onNewIntent()
is called before that
i
You might consider following the advice in the docs and follow the strongly recommended advice to always use the default
launchMode
when using Navigation: https://developer.android.com/guide/navigation/navigation-deep-link#handle
👀 1
Otherwise, you probably want to reverse your flow of information and write your new Intent to a Channel ala https://elizarov.medium.com/shared-flows-broadcast-channels-899b675e805c#49e3 that your Compose can collect on inside a
LaunchedEffect
to handle the new Intent
👀 1
y
Thanks, I will read these now