From b7bd1181e05dd521a8a78cd357d90c7627096e3b Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Wed, 13 May 2026 09:50:02 +0300 Subject: [PATCH] Improved navigation to home screen --- app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt | 4 +++- app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt index e0b829d9..3d7f0ef5 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt @@ -260,7 +260,9 @@ class MainActivity : ComponentActivity() { navController.navigate(route) } is NavigationCommand.NavigateToHome -> { - navController.navigate("main") + navController.navigate("main") { + popUpTo("main") { inclusive = true } + } } } } diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt index 323495b0..89e3c167 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt @@ -2603,6 +2603,7 @@ fun handleIntent(ctx: Context, viewModel: ViewModel, intent: Intent, action: Str Log.w(TAG, "handleIntent 'call' did not find ua $uap") return } + viewModel.navigateToHome() viewModel.dialerState.callUri.value = intent.getStringExtra("peer")!! spinToAor(viewModel, ua.account.aor) if (ev[0] == "call") { @@ -2617,6 +2618,7 @@ fun handleIntent(ctx: Context, viewModel: ViewModel, intent: Intent, action: Str Log.w(TAG, "handleIntent '$action' did not find call $callp") return } + viewModel.navigateToHome() val ua = call.ua spinToAor(viewModel, ua.account.aor, call) if (ev[0] == "call answer")