@Override
            public void handler(Object data, WVJBResponseCallback callback) {
                if (javascriptCloseWindowListener == null
                        || javascriptCloseWindowListener.onClose()) {
                    ((Activity) getContext()).onBackPressed();
                }
            }
set a listener for javascript closing the current activity.
app/src/main/java/com/example/jingbin/webviewstudy/view/WVJBWebView.java