From 398d340d18212a26ae7ea3761006f19e9e0d9b7a Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 9 Jan 2026 10:32:23 +0100 Subject: [PATCH] test(integration): prevent auto-relaunch on Android --- integration-test/net9-maui/App.xaml.cs | 2 -- integration-test/net9-maui/MainPage.xaml.cs | 10 ++++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/integration-test/net9-maui/App.xaml.cs b/integration-test/net9-maui/App.xaml.cs index c187a5ad66..c97382096c 100644 --- a/integration-test/net9-maui/App.xaml.cs +++ b/integration-test/net9-maui/App.xaml.cs @@ -102,8 +102,6 @@ public static void Kill() SentrySdk.Close(); #if ANDROID - // prevent auto-restart - Platform.CurrentActivity?.FinishAffinity(); Process.KillProcess(Process.MyPid()); #elif IOS System.Environment.Exit(0); diff --git a/integration-test/net9-maui/MainPage.xaml.cs b/integration-test/net9-maui/MainPage.xaml.cs index a44a0948df..2f1a8688ce 100644 --- a/integration-test/net9-maui/MainPage.xaml.cs +++ b/integration-test/net9-maui/MainPage.xaml.cs @@ -5,12 +5,10 @@ public partial class MainPage : ContentPage public MainPage() { InitializeComponent(); - } - - protected override void OnAppearing() - { - base.OnAppearing(); - App.OnAppearing(); + this.Loaded += (s, e) => + { + App.OnAppearing(); + }; } }