Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically set / edit content of webview

Tags:

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 any examples.

like image 370
Somk Avatar asked Jun 01 '11 18:06

Somk


1 Answers

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.

like image 94
mah Avatar answered Oct 23 '22 20:10

mah