Martin Larsen Active Member Licensed User Longtime User Nov 20, 2019 #1 I am trying to start Maps from a webview via an intent like here It works in my emulator, but on my phone I get an exception: Code: android.content.ActivityNotFoundException: Unable to find explicit activity class {android/com.android.internal.app.ResolverActivity}; have you declared this activity in your AndroidManifest.xml? at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2112) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1757) at android.app.Activity.startActivityForResult(Activity.java:4803) A problem with Android version?
I am trying to start Maps from a webview via an intent like here It works in my emulator, but on my phone I get an exception: Code: android.content.ActivityNotFoundException: Unable to find explicit activity class {android/com.android.internal.app.ResolverActivity}; have you declared this activity in your AndroidManifest.xml? at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2112) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1757) at android.app.Activity.startActivityForResult(Activity.java:4803) A problem with Android version?
DonManfred Expert Licensed User Longtime User Nov 20, 2019 #2 Martin Larsen said: A problem with Android version? Click to expand... i guess the google maps app is missing or outdated on the device. On my development tablet the app version of GoogleMaps App is: 10.3.0 Upvote 0
Martin Larsen said: A problem with Android version? Click to expand... i guess the google maps app is missing or outdated on the device. On my development tablet the app version of GoogleMaps App is: 10.3.0
Martin Larsen Active Member Licensed User Longtime User Nov 20, 2019 #3 DonManfred said: i guess the google maps app is missing or outdated on the device. Click to expand... It's a Huawei P20 Pro with Android 9 and Google Maps 10.29.2. So it's not missing or outdated. Upvote 0
DonManfred said: i guess the google maps app is missing or outdated on the device. Click to expand... It's a Huawei P20 Pro with Android 9 and Google Maps 10.29.2. So it's not missing or outdated.
Erel B4X founder Staff member Licensed User Longtime User Nov 21, 2019 #4 It is a mistake to use that intent as it is an internal intent. Documented intent: Code: Dim in As Intent in.Initialize(in.ACTION_VIEW, "geo:37.7749,-122.4194") StartActivity(in) Upvote 0
It is a mistake to use that intent as it is an internal intent. Documented intent: Code: Dim in As Intent in.Initialize(in.ACTION_VIEW, "geo:37.7749,-122.4194") StartActivity(in)
Martin Larsen Active Member Licensed User Longtime User Nov 21, 2019 #5 Erel said: It is a mistake to use that intent as it is an internal intent. Click to expand... Ok, but I got it from your post. Why doesn't that apply? In my case, exactly like in that post, I am intercepting a Google Maps link from a webview and want to start Maps externally. Upvote 0
Erel said: It is a mistake to use that intent as it is an internal intent. Click to expand... Ok, but I got it from your post. Why doesn't that apply? In my case, exactly like in that post, I am intercepting a Google Maps link from a webview and want to start Maps externally.
Erel B4X founder Staff member Licensed User Longtime User Nov 21, 2019 #6 Martin Larsen said: Ok, but I got it from your post. Why doesn't that apply? Click to expand... This is not my code. I've just fixed a small thing with the code someone else posted. To avoid confusion I deleted this post. Upvote 0
Martin Larsen said: Ok, but I got it from your post. Why doesn't that apply? Click to expand... This is not my code. I've just fixed a small thing with the code someone else posted. To avoid confusion I deleted this post.
Martin Larsen Active Member Licensed User Longtime User Nov 21, 2019 #7 Ok that explains it. But can I start Maps from an url using the geo: intent? Also, the referred example works fine in the emulator. Upvote 0
Ok that explains it. But can I start Maps from an url using the geo: intent? Also, the referred example works fine in the emulator.
Erel B4X founder Staff member Licensed User Longtime User Nov 21, 2019 #8 Yes. The exact details depend on the input URL. Google maps intents are documented here: https://developers.google.com/maps/documentation/urls/android-intents Upvote 0
Yes. The exact details depend on the input URL. Google maps intents are documented here: https://developers.google.com/maps/documentation/urls/android-intents
Martin Larsen Active Member Licensed User Longtime User Nov 21, 2019 #9 Thanks. It seems that by properly forming the urls in the first case I don't even have to intercept them. They will open in Maps automatically. Like the example from the guide - that will open in Maps. At least from the main browser - I will try it in a webview. Upvote 0
Thanks. It seems that by properly forming the urls in the first case I don't even have to intercept them. They will open in Maps automatically. Like the example from the guide - that will open in Maps. At least from the main browser - I will try it in a webview.
Martin Larsen Active Member Licensed User Longtime User Nov 21, 2019 #10 Martin Larsen said: At least from the main browser - I will try it in a webview. Click to expand... These specially formed urls only works in the main browser, not in a webview. Here is just shows the map page in the webview. But this works: Code: Sub wv_OverrideUrl (Url As String) As Boolean Log(Url) If Regex.IsMatch2(".*://www.google.\w+/maps/.*", Regex.CASE_INSENSITIVE, Url) Then Intent1.Initialize(Intent1.ACTION_VIEW, Url) StartActivity(Intent1) Return True End If Return False End Sub Upvote 0
Martin Larsen said: At least from the main browser - I will try it in a webview. Click to expand... These specially formed urls only works in the main browser, not in a webview. Here is just shows the map page in the webview. But this works: Code: Sub wv_OverrideUrl (Url As String) As Boolean Log(Url) If Regex.IsMatch2(".*://www.google.\w+/maps/.*", Regex.CASE_INSENSITIVE, Url) Then Intent1.Initialize(Intent1.ACTION_VIEW, Url) StartActivity(Intent1) Return True End If Return False End Sub