jenson-button-event
jenson-button-event

Reputation: 18941

Webview loading local file yields stock 404 screen

I am testing a working app for backwards compatibility.

I am loading a site into a webview from the local filesystem:

protected void onCreate(Bundle savedInstanceState) {
    // set up webview etc
    // load 
    mWebView.loadUrl("file:////android_asset/index.html");
}

In Jelly Bean this initially loads the stock 404 screen (Webpage not available) with a link to that path. Clicking the path loads the site.

At a loss of what to do here...

Upvotes: 0

Views: 99

Answers (1)

SpaceBison
SpaceBison

Reputation: 3131

You've got one slash too many in the uri. It should be file:///android_asset/index.html.

Upvotes: 1

Related Questions