java - android webview loading images -


i have looked @ 50+ sources, none give exact information

loading html webview images in code make webview load images, when exists in assets

i can make webview show images other sites well

i creating images dynamically, , want show them in webview

i cannot copy files assets folder, cannot load them there either

it if planned prevent specific functionality striving for.

there many answers providing solutions, none work, , many years ago.

i want load files exist in getfilesdir(); directory, because created there.

i'd appreciate help, thank you.

i have tried

all these:

webview.getsettings().setallowfileaccess(true); webview.getsettings().setallowcontentaccess(true); webview.getsettings().setallowfileaccessfromfileurls(true); webview.getsettings().setallowuniversalaccessfromfileurls(true); webview.getsettings().setbuiltinzoomcontrols(true); webview.getsettings().setloadsimagesautomatically(true); webview.getsettings().setjavascriptenabled(true); 

& many many combinations of urls trying access file @ getfilesdir(); in html code none work except loading other sites, , assets cannot write to.

i can add images directly html calculating base64 string of image , adding html tag+code/url:

<img src="data:image/jpg;base64,######base64string#######"> 

how generate base 64 string you. still searching method make webview load images getfilesdir();, working directory of app.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -