1

I have problems loading my local html in to webView in my Application heres the code -

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_weekly);
    WebView ww = (WebView) findViewById(R.id.webViewer5);
    ww.addJavascriptInterface(new myJsInterface(this), "Android");
    ww.loadUrl("file:///assets/pro/index.html");

The Result from the App says:

Webpage Not available the Web page at file:///assets/pro/index.html might be temporarily down or it may have moved permanently to a new web address.

The HTML file works fine alone or in a browser just not in the webViewer.

1 Answer 1

1

assets folder should be accessed using file:///android_asset. change to below:

ww.loadUrl(" "file:///android_asset/pro/index.html"); or ww.loadUrl(" "file:///android_asset/index.html"); (since i cant see your directory structure)

Sign up to request clarification or add additional context in comments.

1 Comment

CAN SOMEONE GIVE ME A VOTE FOR THIS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.