Android Question Urgent Help needed! Unable to load html page in webView

Daestrum

Expert
Licensed User
Longtime User
If you post the code you have tried, it makes it so much easier to see why it isn't working and hopefully give you a solution to the problem.
 
Upvote 0

manzoor

Member
As earlier mentioned, I'm new, don't know much about this. I used this code:

#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region

#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
Private WebView1 As WebView

Private Button1 As Button


End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button1_Click
WebView1.JavaScriptEnabled = True
xui.MsgboxAsync("Hello world!", "B4X Title")
WebView1.LoadUrl("https://https://imzmart.com/ad-test.html")
End Sub
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Looks like a typo, you have https://https:// in the LoadUrl line.

WebView1.LoadUrl("https://https://imzmart.com/ad-test.html")
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Hello, I'm new and I'm going to load a webpage (https://imzmart.com/ad-test.html) in webview but this page is not loading as it has some javascript
Kindly guide how I can load this page successfully
try this
B4X:
Private WebViewExtras1 As WebViewExtras
    Private WebViewSetting1 As WebViewSettings
    Private WebChromeClient1 As DefaultWebChromeClient
    Private JavascriptInterface1 As DefaultJavascriptInterface
    
    Dim jo As JavaObject = wvMAR
        jo.RunMethod("setLayerType", Array(2, Null))
    
        WebViewExtras1.SetWebChromeClient(WebChromeClient1)
        WebViewSetting1.setDatabaseEnabled(wvMAR, True)
        WebViewSetting1.setDOMStorageEnabled(wvMAR, True)
        WebViewSetting1.setGeolocationEnabled(wvMAR, True)
    
        WebViewSetting1.setSaveFormData(wvMAR, False)
        WebViewSetting1.setSavePassword(wvMAR, False)
        WebViewSetting1.setJavaScriptCanOpenWindowsAutomatically(wvMAR, False)
    
        WebViewSetting1.setSupportZoom(wvMAR, False)
        WebViewSetting1.setUseWideViewPort(wvMAR, False)
        WebViewSetting1.setMediaPlaybackRequiresUserGesture(wvMAR, False)
    
        WebViewSetting1.setDatabasePath(wvMAR, "")
 
Upvote 0
Top