@Override
        public void handleMessage(Message msg) {
            final Context context = mContextReference.get();
            if (context != null) {
                switch (msg.what) {
                    case EXEC_SCRIPT:
                        _evaluateJavascript((String) msg.obj);
                        break;
                    case LOAD_URL:
                        WVJBWebView.super.loadUrl((String) msg.obj);
                        break;
                    case LOAD_URL_WITH_HEADERS: {
                        RequestInfo info = (RequestInfo) msg.obj;
                        WVJBWebView.super.loadUrl(info.url, info.headers);
                    }
                    break;
                    case HANDLE_MESSAGE:
                        WVJBWebView.this.handleMessage((String) msg.obj);
                        break;
                }
            }
        }
Created by du on 16/12/29.
https://github.com/wendux/WebViewJavascriptBridge
app/src/main/java/com/example/jingbin/webviewstudy/view/WVJBWebView.java