1. 程式人生 > >android 呼叫js webView網頁,點選提交按鈕無效(注意加上setWebChromeClient())

android 呼叫js webView網頁,點選提交按鈕無效(注意加上setWebChromeClient())

 // 如果不設定這個,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()
        {

            @Override
            
public boolean onJsAlert(WebView view, String url, String message, JsResult result) { // TODO Auto-generated method stub return super.onJsAlert(view, url, message, result); } });