mWebView.loadUrl("file:///android_asset/main.html");
mWebView.setWebViewClient(new MyWebViewClient());
mWebView.setScrollContainer(false);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setSaveFormData(true);
mWebView.getSettings().setBuiltInZoomControls(false);
mWebView.addJavascriptInterface(new JavaScriptInterface(this),"Android");
mWebView.setWebChromeClient(new WebChromeClient()
{
// Show javascript logs in LogCat
public void onConsoleMessage(String message, int lineNumber,String sourceID)
{
Log.d("MyApplication", message + " -- From line " + lineNumber + " of " + sourceID);
}
});
Learn about the Android Development and how it can be used to create mobile and non-mobile applications.This website give full tutorials for develop android application and it is absolutely free.
Showing posts with label WebView. Show all posts
Showing posts with label WebView. Show all posts
Tuesday, March 20, 2012
How to show html page from asserts
Subscribe to:
Posts (Atom)