Android Question Linking local image in webview with LoadURL()

Discussion in 'Android Questions' started by AmenO123, Dec 6, 2018.

  1. AmenO123

    AmenO123 Member Licensed User

    Say I have logo.jpg added to the assets folder how can I use LoadURL() method and have that image referenced in the HTML code? (external URL)

    or I can only use LoadHTML()?

    I already tried:
    <img src='file:///android_asset/logo.jpg'/>
    But it didn't work

    Thank You.
  2. mcqueccu

    mcqueccu Active Member Licensed User

  3. AmenO123

    AmenO123 Member Licensed User

  4. Erel

    Erel Administrator Staff Member Licensed User

    You will need to download the html with OkHttpUtils2, modify the links and then load it with WebView.LoadHtml.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice