How to hyperlink android html assets when using chrome client? -


I have a main page (main.html) in the asset folder with which I'm displaying:

  webview.setWebChromeClient (New MyWebChromeClient ()); Webview.getSettings () setJavaScriptEnabled (true). Webview.addJavascriptInterface (new version CallbackScript (), "Demo"); Webview.loadUrl ("File: ///android_asset/main.html");  

And I want to put a link in the property folder in another HTML file in the document. When I put in the tag equally:

  & lt; A href = "file: ///android_asset/secondpage.html" touch here for page 2 & lt; / A & gt; & Lt; / Font & gt; & Lt; / H4 & gt;  

And in the client, touch it, the screen loads the blank page.

Likewise, I have the contents of a table, which is a list view and uses loadUrl with one HTML page is stacked with an anchor I tried and it is not working

  string anchor = "section 1"; Webview.loadUrl ("File: ///android_asset/main.html" + "#" + Anchor);  

This construction is not working either.

Try

  & lt; A href = "secondpage.html" & gt; Touch here for Page 2 & lt; / A & gt;  

This works for me.


Comments