I can't for the life of me load a simple url. The WebView just pops up blank.
Here's my code:
Sub Process_Globals
End Sub
Sub Globals
Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
WebView1.Initialize("WebView1")
url = "http://google.com"
WebView1.LoadUrl(url)
End Sub
My end goal is to show a loading gif then once the page is loaded display it.
It is simple and I prefer to dim that url As String like this:
This is basic:
B4X:
Sub Globals
Dim url As String
url = "http://google.com"
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
WebView1.Initialize("WebView1")
activity.AddView(webview1,0dip, 0dip, 100%x, 100%y)
WebView1.LoadUrl(url)
End Sub
And this is with Progress Dialog:
B4X:
Sub Globals
Dim WebView1 As WebView
Dim url As String
url = "http://google.com"
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
WebView1.Initialize("WebView1")
activity.AddView(webview1,0dip, 0dip, 100%x, 100%y)
WebView1.LoadUrl(url)
ProgressDialogShow("Loading " &url)
End Sub
Sub webview1_PageFinished (StrUrl As String)
ProgressDialogHide
ToastMessageShow("Loaded " &StrUrl, False)
End Sub
It is simple and I prefer to dim that url As String like this:
This is basic:
B4X:
Sub Globals
Dim url As String
url = "http://google.com"
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
WebView1.Initialize("WebView1")
activity.AddView(webview1,0dip, 0dip, 100%x, 100%y)
WebView1.LoadUrl(url)
End Sub