0

I know that there are a lot of questions about to load HTMl-pages into WebView. What am I doing? I just put down the 1.html in assets folder in android-project and use

myWebView.loadUrl("file:///assets/"+selectedItem+".html");

where selecteditem

is data from intent. As result I get the message in WebView that:

file:///assets/1.html was not found.

UPD: sorry, I found the solution. the correct path should be the follow:

myWebView.loadUrl("file:///android_asset/"+selectedItem+".html");
Eugene Shmorgun
  • 2,083
  • 12
  • 42
  • 67

2 Answers2

1

The correct path is file:///android_asset/1.html

NitroG42
  • 5,336
  • 2
  • 28
  • 32
0

I am not sure,but it may work:

webView.loadUrl("file:///android_asset/1.html");

Know more about the same type of mistake: Loading existing .html file with android WebView

Community
  • 1
  • 1
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295