I have an Android app that displays a comic book. To make use of the built-in zoom controls, I am loading the pictures in a WebView
like so:
webView.loadUrl("file:///android_asset/page1.jpg");
This is working just fine, however, since the images are in the assets folder, they are not being compressed which makes my .apk enormous. I was wondering how to reference resource files (from the res/drawable
folder) with a file path like I did above with the assets. Does anyone know what that path would look like? I've tried things like "file:///res/drawable/pagetitle.jpg"
with no success. Thanks for the help.
Update:
I found that "file:///android_res/drawable/page1.jpg"
was the path that I was looking for.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…