开发者

How to programmatically set / edit content of webview

开发者 https://www.devze.com 2023-03-09 16:53 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消