WebView1.Initialize(WebView1) ' at this point it show a perple line and remind me that it is string But no error
rem if I write WebView1.Initialize("WebView1") it is the same
Activity.AddView (WebView1,0,0,100%x,50%y)
Url="https://youtu.be/gIb00j1x2Pk"
WebView1.LoadUrl( Url)
and at the timer_tick
the code
sub timer1_tick()
Dim Url As String
timer1.Enabled=False
Url="https://youtu.be/k5uaVRRMEGI"
WebView1.LoadUrl( Url)
end sub
with the designer I have create an webview1 object at the bottom of the screen
when the activity starts it create the webview1 at the top, load the video and start to play
after it enter at the timer It load the webview1 at the object I have create with the designer
The webview1 form the designer it is at the bottom
So I see the video on the to (with add commad) and the video at the bottom on the webview form the designer
I got the same thing as you using your code - might be a slight issue with your code.
I rewrote your code using some I already knew would work - please try this
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim wv As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
wv.Initialize("wv")
Activity.AddView(wv,0,0,100%x,50%y)
Dim Url="https://youtu.be/gIb00j1x2Pk" As String
wv.LoadUrl(Url)
End Sub
Not sure you need the LoadLayout part for the main Activity anyway