How to open Android's default webbrowser when clicking a link in webview

moster67

Expert
Licensed User
Longtime User
This may sound a bit strange but how can I open Android's default webbrowser when a user is clicking a http-url (link) in my webview?

Is there some kind of html-tag which opens a new browser-windows and perhaps will open the default-browser instead of navigating further within the webview?
 

moster67

Expert
Licensed User
Longtime User
Thanks Margret.

So that's the purpose of OverrideUrl. Will try it when I get back home from work.

Sent from my HTC HD2
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
Hmm..I can't get this to work. I am unable to catch the event when a user clicks on a http_link within my webview (which originally loaded a local stored html-page).

In the Activity_Create sub I added:

webview1.Initialize("test")

Then I created a sub (where I hoped to catch the event of clicking on a HTTP-link and retrieve the corresponding URL) as follows:

Sub test_OverrideUrl (Url As String) As Boolean
Log("debug: " & url)
End Sub

There must be something I haven't understood. Anyone who can shed some light or post an example?
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
Your test_OverrideUrl Sub looks fine to me.

Can you post your entire project - the error must be elsewhere.

Martin.
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
My bad :BangHead: :BangHead:

I was using the wrong event-name in my code. Corrected it and now everything is OK.

Sorry for making you loose your time.


Your test_OverrideUrl Sub looks fine to me.

Can you post your entire project - the error must be elsewhere.

Martin.
 
Upvote 0
Top