简体   繁体   中英

Load bitmap as a content of webview

First I load the bitmap from url and then I want to load this bitmap to webview element. Is there a way to load bitmap from the app install folder?

If you only want to show off the Bitmap, you might want to use an ImageView .

Otherwise, I guess the picture is in your res/drawable or assets -folder:

To show the Image from the assets -folder use the following:

browser.loadUrl("file:///android_asset/yourfile.png");

Where browser is your WebView -Object.


To show the Image from the res -folder, you use something like this:

browser.loadUrl("file:///android_res/drawable/yourfile.png");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM