Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android HTML resource with references to other resources

I would like to add an HTML resource to my Android project with references to other resources (mainly drawables).

Where should I put it and how do I reference other resources from it?

Is there a particular way to pass the HTML resource to a WebView?

Thanks!

like image 256
hpique Avatar asked Dec 13 '22 20:12

hpique


1 Answers

The html file goes into the assets folder in root (as a sibling folder of res), as well as all the drawables. You can view it by doing something like

webView.loadUrl("file:///android_asset/filename.html");
like image 71
EboMike Avatar answered Dec 21 '22 23:12

EboMike