android 呼叫js webView網頁,點選提交按鈕無效(注意加上setWebChromeClient())
阿新 • • 發佈:2019-01-28
// 如果不設定這個,JS程式碼中的按鈕會顯示,但是按下去卻不彈出對話方塊 // Sets the chrome handler. This is an implementation of WebChromeClient // for use in handling JavaScript dialogs, favicons, titles, and the // progress. This will replace the current handler. myWebView.setWebChromeClient(new WebChromeClient() { @Overridepublic boolean onJsAlert(WebView view, String url, String message, JsResult result) { // TODO Auto-generated method stub return super.onJsAlert(view, url, message, result); } });