Skip to content

Instantly share code, notes, and snippets.

@jiemachina
Created September 21, 2012 10:01
Show Gist options
  • Save jiemachina/3760716 to your computer and use it in GitHub Desktop.
Save jiemachina/3760716 to your computer and use it in GitHub Desktop.
webview 数据库基本设置
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setDatabaseEnabled(true);
// mWebView.getSettings().setDomStorageEnabled(true);
// mWebView.requestFocus(View.FOCUS_DOWN);
mWebView.requestFocus(View.FOCUS_DOWN);
// mWebView.addJavascriptInterface(new
// JavaScriptInterface(RecommendActivity.this, bookId,bookName),
// "android");
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
mWebView.setWebViewClient(new MyWebViewClient(this));
mWebView.setWebChromeClient(new WebChromeClient() {
public void onConsoleMessage(String message, int lineNumber,
String sourceID) {
Log.d("MyApplication", message + " -- From line " + lineNumber
+ " of " + sourceID);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment