I try to load the html file with this line. (I get file name from intent)
webView.loadUrl("file:///android_res/raw/content/" + file + ".html");
The html file is at:
/raw/res/content/1-introduction.html
I get this error:
The webpage at "file:///android_res/raw/content/1-introduction.html" couldn't be loaded because net:ERR_FILE_NOT_FOUND
What am I missing?
2
Answers
I moved my files into /assets/content folder and called like this. Worked.
To load files packed in your application, you should use special WebViewAssetLoader. There is a full guide. In general, you have to use special path handlers to operate local files.