Android Question Google Map - Call button action

Gaver Powers

Member
Licensed User
Longtime User
I am using a webview to load a google map like...

B4X:
Main.dest = "Tarpon Springs, FL Taxi"
WebView1.LoadURL("https://maps.google.com/maps?q="&Main.dest)

The resulting map is shown in pic 1 below.
The results of clicking on the phone icon to call the number shown is in pic 2.

Is there a way to capture the phone icon click event and bring up the phone dialer dialog?
Or pass the click thru to the android os to process instead of the app?
All other buttons on the map page work correctly - just the phone dialer that's not functioning correctly.

GP
 

Attachments

  • Screenshot_2014-11-09-10-27-05.png
    Screenshot_2014-11-09-10-27-05.png
    403.9 KB · Views: 121
  • Screenshot_2014-11-09-10-27-13.png
    Screenshot_2014-11-09-10-27-13.png
    100.8 KB · Views: 114

Gaver Powers

Member
Licensed User
Longtime User
I added:

B4X:
Sub WebView1_OverrideUrl (Url As String) As Boolean
   Log("URL = " & Url)
   Return True
End Sub

It still directs to the broken web page.

Is there an example of implementing the OverrideUrl event that demonstrates how to capture the URL being requested and dump it to the log?

G
 
Upvote 0

Gaver Powers

Member
Licensed User
Longtime User
I'm wondering if the page from google is rendered using JavaScript and it not being translated by t he override event correctly.

The URL is not being printed to the log.
I am seeing "** Activity (map) Create, isFirst = true **" in the log.

B4X:
#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
Dim WebView1 As WebView

End Sub

Sub Activity_Create(FirstTime As Boolean)
   
    WebView1.Initialize("")
    Activity.AddView(WebView1, 0, 0, -1, -1)
    WebView1.LoadURL("https://maps.google.com/maps?q="&Main.dest)

End Sub

Sub WebView1_OverrideUrl (Url As String) As Boolean
    Log("URL = " & Url)
    Return True
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

    StartActivity(Main) 'show the main activity again
   
End Sub


Sub WebView1_PageFinished (Url As String)
  
End Sub

Sub WebView1_UserAndPasswordRequired (Host As String, Realm As String) As String()
  
End Sub
 
Upvote 0
Top