Chris Fillmore
07/23/2021, 8:51 PMonNewIntent()
when using Compose Navigation? My use case is similar to e.g. OAuth authorization flow. I am redirecting back to an Activity via <intent-filter>, and starting the Activity with SINGLE_TOP. There will be a route in the new Intent, which I want to navigate to. Has anyone handled something like this?
Here’s some dummy code example of what I mean:
class MyActivity {
fun onCreate() {
setContent { MyApp() }
}
fun onNewIntent(intent: Intent) {
val route = intent.getStringExtra("redirect_route")
?? What to do with 'route'
}
}
@Composable
fun MyApp() {
val navController = rememberNavController()
MyNavHost(navController)
}
@Composable
fun MyNavHost(controller: NavController) {
NavHost(...) {
... define routes ...
}
}
Chris Fillmore
07/23/2021, 8:56 PMallan.conda
07/24/2021, 8:24 AMallan.conda
07/24/2021, 8:25 AMChris Fillmore
07/28/2021, 10:43 AMallan.conda
07/28/2021, 10:44 AMChris Fillmore
07/28/2021, 10:50 AMallan.conda
07/28/2021, 11:23 AMChris Fillmore
07/28/2021, 5:57 PMChris Fillmore
07/28/2021, 7:35 PMhandleDeepLink()
explicitly
https://developer.android.com/guide/navigation/navigation-deep-link#handleIan Lake
07/28/2021, 7:54 PMChris Fillmore
07/28/2021, 8:01 PMhandleDeepLink()
isn’t the end of the world. Could/should I submit a feature request for handling different launch modes?Ian Lake
07/28/2021, 8:56 PMChris Fillmore
07/28/2021, 9:09 PMIan Lake
07/28/2021, 9:55 PMdeepLink
on your destination you want to handle the deep linkChris Fillmore
08/06/2021, 4:19 PM