Android Question Webview

GiulioVale

Active Member
Licensed User
Longtime User
I always have a blank page inside webview with this code. Any suggestion?

B4X:
Sub show_doc_popup(doc As String )
    Dim cd As CustomDialog
    Dim WebView1 As WebView
    Dim ret As Int
    Dim doc1 As String
    doc1="<html><title></title><body><p>test<p></body></html>"
    WebView1.Initialize("WebView1")
    cd.AddView(WebView1, 0, 0, 50%x, 50%y)
    WebView1.LoadHtml(doc1 )
    ret = cd.Show("", "Close", "", "", Null)
   
End Sub

Thanks
 

barx

Well-Known Member
Licensed User
Longtime User
The <title> tag should be within a <head></head> tag
 
Upvote 0

GiulioVale

Active Member
Licensed User
Longtime User
The <title> tag should be within a <head></head> tag
OK. I'am sorry for this my stupid error but problem is not html. The same wrong html work inside a webview that is not inside a customdialog.
Problem is webview inside customdialog. Any solution?
Edit also if I change

WebView1.LoadHtml(doc1 ) to
WebView1.LoadUrl("http://www.google.com" ) this not work with customdialog
 
Upvote 0

GiulioVale

Active Member
Licensed User
Longtime User
On both my devices the code works.
I see a white rectangle with the word "test" in the top left corner !

Best regards.
Inside a dialog? I have a galaxy S4 and there is only the white rectangle whithout any "test" inside.
Thanks for reply
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Attached a screenshot from my Nexus One.

Best regards.
 

Attachments

  • ScreenShot.png
    ScreenShot.png
    8.8 KB · Views: 241
Upvote 0
Top