23

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.

Somk
  • 11,869
  • 32
  • 97
  • 143

2 Answers2

71

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.

Jorge Cordero
  • 142
  • 2
  • 6
mah
  • 39,056
  • 9
  • 76
  • 93
2

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

Dan F
  • 17,654
  • 5
  • 72
  • 110