How to programmatically set / edit content of webview
Is there a way I can edit the content either to add to or create from scratch via the java? I haven't been able to find an开发者_Python百科y examples.
You should look at the WebView documentation here.
Among other great bits of information there, you'll find:
// OR, you can also load from an HTML string:
String summary = "<html><body>You scored <b>192</b> points.</body></html>";
webview.loadData(summary, "text/html; charset=utf-8", "utf-8");
// ... although note that there are restrictions on what this HTML can do.
// See the JavaDocs for loadData() and loadDataWithBaseURL() for more info.
very close to the top of the page.
WebView.loadData
can be passed a straight HTML string. I use a "page" i create from scratch in my app that is just formatted with HTML
精彩评论