Closed mbalous closed 2 years ago
This is expected as technically each OS may not have a map app installed or disabled. I will update the documentation to specify the try/catch needed here.
An enhancement my be "TryOpenAsync" like we have done before as a fire/forget
Yes, TryOpenAsync() would be great, similar to Launcher.TryOpenAsync(string uri)
.
@jamesmontemagno I've made PR for that :) https://github.com/xamarin/Essentials/pull/1665
Thank you so much for all your time and effort on this one. To make your effort not go in vein I ported it to .NET MAUI as you can see here: https://github.com/dotnet/maui/pull/5834
We won't be able to add this to Xamarin.Essentials anymore unfortunately. Thanks again!
Description
An exception Android.Content.ActivityNotFoundException is thrown when no app to open maps is installed.
Steps to Reproduce
await Map.OpenAsync(location)
Expected Behavior
Nothing or maybe
false
returned.Actual Behavior
Exception Android.Content.ActivityNotFoundException thrown
Basic Information
Stack trace
``` {Android.Content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=google.navigation:q=50.0789,14.4244&mode=d flg=0x14001000 } at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0006e] in <9324da45a6654f83baffa7c2854d836a>:0 at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <9324da45a6654f83baffa7c2854d836a>:0 at Android.Content.ContextWrapper.StartActivity (Android.Content.Intent intent) [0x00031] in