webview.loadurl

caillaud

Member
Licensed User
Longtime User
hi
Sub Globals
Dim webview1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
webview1.Initialize("webview1")
webview1.LoadUrl("google.com")
End Sub

nothing happens
what is missing?
thanks in advance
michel
 

icefairy333

Active Member
Licensed User
Longtime User
you need to add the view to the activity,or design a layout file and load it ;
for example you can change the code :webview1.LoadUrl("google.com") to this:
B4X:
activity.addview(webview1,0dip,0dip,100%x,100%y)
webview1.loadurl("http://google.com")
don't forgot the "http://"
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
You have to add the WebView to the activity and enter the whole URL, like this:
B4X:
webview1.Initialize("webview1")
Activity.AddView(webview1, 0dip, 0dip, 100%x, 100%y)
webview1.LoadUrl("http://www.google.com")
 
Last edited:
Upvote 0

caillaud

Member
Licensed User
Longtime User
thanks a lot
it works
I would like to simulate an internet explorer navigator under a webview
I was advised to use:
setUserAgentString (webview1, myuseragent)
I got the IE useragent string from internet
Where can I find and download the library where is the routine:setUserAgentString

sincerely

michel
 
Upvote 0
Top