Android Question webview not show images

b2mvga

Member
Licensed User
Longtime User
Hi

With new android 30 I have to change the File.DirRootExternal to File.DirInternal.

Before change, I have one webview showing images on DirRootExternal:
WebView1.LoadHtml("<html><body bgcolor='black'><center><img src='file://" & File.DirRootExternal & "/prog/fotos/0001.gif & "'></center></body></html>")

After change to DirInternal and copy images to DirInternal and change code webview not show images...
WebView1.LoadHtml("<html><body bgcolor='black'><center><img src='file://" & File.DirInternal & "/prog/fotos/0001.gif& "'></center></body></html>")

If I use a ImageView code like this, image as show correctly in ImageView:
Imageview1.Bitmap=LoadBitmap(File.DirInternal & "/prog/fotos","0001.gif")

What I do wrong?
 

b2mvga

Member
Licensed User
Longtime User
Hi, Solved with this code:

code:
        Private wvsetttings As WebViewSettings
        wvsetttings.setAllowFileAccess(WebView1,True)
        wvsetttings.setSupportZoom(WebView1,True)
        wvsetttings.setDisplayZoomControls(WebView1,True)
        Dim XUI As XUI
        Dim imagePath As String=XUI.FileUri(CaminhO,Mimagem)
        WebView1.LoadHtml($"<HTML><HEAD></HEAD><BODY><IMG SRC="${imagePath}"></BODY></HTML>"$)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…