Android Question WebViewExtras2 : Replacing an image with another remote image

Martin Larsen

Active Member
Licensed User
Longtime User
This example shows how to replace an image with another one from a local resource.

Here is a snippet from the example:

B4X:
Select Url
        Case "http://www.b4x.com/android/forum/data/avatars/m/38/38207.jpg?1377605759"
            '    this should replace Rorry's avatar with a scooby doo image!
            Dim WebResourceResponse1 As WebResourceResponse
            WebResourceResponse1.Initialize("image/jpeg", Null, File.OpenInput(File.DirAssets, "scooby-doo-96x96.jpg"))
            Return WebResourceResponse1
        Case Else
            '    default action - let the webView retrieve the resource
            Return Null
    End Select

But I want to replace the image with another remote image (on the web), not from the DirAssets.

Is that possible?
 
Last edited:
Top