views:

85

answers:

1

I have a main page (main.html) in the assets folder that I am displaying with:

webview.setWebChromeClient(new MyWebChromeClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.addJavascriptInterface(new VersionCallbackScript(), "demo");
webview.loadUrl("file:///android_asset/main.html");

and I want to put a link in the document to another html file in assets folder. When I similiarly put in the tag:

<a href="file:///android_asset/secondpage.html">Touch here for page 2</a></font></h4>

and touch it in the client, the screen loads a blank page.

likewise, I want to have a table of contents that isA ListView and uses loadUrl with an html page suffixed with an anchor. I tried and it is not working

String anchor = "subsection1";
webview.loadUrl("file:///android_asset/main.html" + "#" + anchor);

this construct is not working either.

A: 

Give a try to the following piece of code

<a href="secondpage.html">Touch here for page 2</a>

For me it does the job.

chromate
OMG - both forms are now working for me, but I have to thank you for trying it to verify. You get the +50. Thanks!
mobibob
I'm glad it works now. Sometimes it's a bit ensorcelled. ;)
chromate