Wednesday, June 4, 2014

How to open a new layout after button click in android

Use the below code,

How to write static HTML code in WebView control

Apply the below code,

webView = (WebView) findViewById(R.id.webView1);
webViewSettings = webView.getSettings();
webViewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webViewSettings.setJavaScriptEnabled(true);
webViewSettings.setBuiltInZoomControls(true);
webViewSettings.setPluginState(PluginState.ON);
webView.getSettings().setJavaScriptEnabled(true);
String data="<h1>welcome to Android example..Write your own HTML code here..</h1><br>";
webView.loadData(data, "text/html","utf-8");