I'm displaying an HTML document using a WebView
. The HTML document is contained in an HTML string. I pass the HTML string to the WebView
by using its loadDataWithBaseURL()
method, as follows (I got it from this answer):
webView.loadDataWithBaseURL("fake://not/needed", getResources().getString(R.string.htmlString), "text/html", "utf-8", "");
Now, I'd like to show the HTML document contained in that HTML string starting not at the document's beginning, but at a given HTML anchor contained in the HTML string.
Can I do that with webView.loadDataWithBaseURL()
? Or more gnerally: is there any method to show local content on a WebView starting at an anchor?