I imported .html file into android application (assets/www/.html). Now i tried to access that data to my app as webview.loadUrl("file://android_assets/www/index.html");. But while running it in eclipse, Emulator is showing "webpage not available ". Any help is appreciatable.
-
Could it be that the file must be referenced locally? Maybe try it without "file:///" at all - just try "/android_assets/www/index.html" or "android_assets/www/index.html".Codesmith– Codesmith2013-11-09 16:30:24 +00:00Commented Nov 9, 2013 at 16:30
Add a comment
|
5 Answers
i guess you need to use file:///android_asset instead of file://android_assets in your file path.
webview.loadUrl("file:///android_asset/www/index.html");
I am not sure whether this is the solution to your problem. But maybe your application doesn't work because it tries to find a url in the internet instead of a file name. You should try uploading your file and change the location to http://... .
2 Comments
Ravikiran
Where should i upload my file? I already imported to my app "asset/www/index.html".
Fernando Valente
It won't look for the file on the web. The URL has the "file://" protocol.