I want open webview object on new Activity page. Below my codes
My B4XMainPage
My FrmActivity2Page (FrmActivity2.bal)
My second activity page
My B4XMainPage
B4X:
#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private WebView1 As WebView
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
WebView1.LoadUrl("https://google.com") '<----------- Here working well
End Sub
Private Sub Button1_Click
StartActivity(Activity2)
End Sub
My FrmActivity2Page (FrmActivity2.bal)
B4X:
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Private WebView1 As WebView
End Sub
'You can add more parameters here.
Public Sub Initialize As Object
Return Me
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("FrmActivity2")
WebView1.LoadUrl("https://google.com") '<----------- Here cannot working
End Sub
Private Sub Button1_Click
StartActivity(Activity2)
End Sub
My second activity page
B4X:
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("FrmActivity2")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub