Difference between revisions of "Android create html webview"

From John Freier
Jump to: navigation, search
(Created page with 'This creates and html page and uses the webview to display it. String html = "<html><body>Hello, World!</body></html>"; String mime = "text/html"; String encoding = "utf-8"; …')
 
(No difference)

Latest revision as of 16:39, 20 June 2011

This creates and html page and uses the webview to display it.

String html = "<html><body>Hello, World!</body></html>";
String mime = "text/html";
String encoding = "utf-8";

WebView myWebView = (WebView)this.findViewById(R.id.webView1);
myWebView.getSettings().setJavaScriptEnabled(false);
myWebView.loadDataWithBaseURL(null, html, mime, encoding, null);