internal Task <bool> TryOpenUri(string uri) { var intent = ResolveMapIntent(uri); var canStart = PlatformUtils.IsIntentSupported(intent); if (canStart) { Platform.AppContext.StartActivity(intent); } return(Task.FromResult(canStart)); }
static void LaunchExternalBrowser(BrowserLaunchOptions options, AndroidUri?nativeUri) { var intent = new Intent(Intent.ActionView, nativeUri); var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask; #if __ANDROID_24__ if (OperatingSystem.IsAndroidVersionAtLeast(24)) { if (options.HasFlag(BrowserLaunchFlags.LaunchAdjacent)) { flags |= ActivityFlags.LaunchAdjacent; } } #endif intent.SetFlags(flags); if (!PlatformUtils.IsIntentSupported(intent)) { throw new FeatureNotSupportedException(); } Application.Context.StartActivity(intent); }
Task <bool> PlatformCanOpenAsync(Uri uri) { var intent = new Intent(Intent.ActionView, AndroidUri.Parse(uri.OriginalString)); return(Task.FromResult(PlatformUtils.IsIntentSupported(intent))); }