In your device, you have three browsers and you donot set the default browser, So you will get this pop up window that want you to choose one of them to open the url.
I make a test to install other broswer. I can get the same popup window as you get.
You can set the default browser then make a test, if you can execute code, you cannot get the pop up window, just open the url like your second screenshot.
If you want to know more details about the BrowserLaunchMode.SystemPreferred
, we can use source code to verify that is open default browser
please open the Xamarin.Essentials Browser's source code: https://github.com/xamarin/Essentials/blob/main/Xamarin.Essentials/Browser/Browser.android.cs
As above source code, we can see the difference between BrowserLaunchMode.SystemPreferred
and BrowserLaunchMode.External
, BrowserLaunchMode.SystemPreferred
use CustomTabsIntent.Builder
to open the browser, but BrowserLaunchMode.External
to use startActivity to open your url,
First of all, we can see CustomTabsIntent.Builder
, this class come from AndroidX.Browser.CustomTabs;
(for android 10.0) or Android.Support.CustomTabs;
(before android 10.0), Obviously the class come from native Android ,then we can search the google document about AndroidX.Browser.CustomTabs;
, https://developers.google.com/web/android/custom-tabs/implementation-guide#opening_a_custom_tab, in this article, we found Custom Tabs integration is adding the AndroidX Browser Library, In other words,Custom Tabs that used AndroidX Browser Library to achieve it. in the end, open the AndroidX Browser Library, we will found that Display webpages in the user's default browser.