@SuppressLint({"JavascriptInterface", "SetJavaScriptEnabled"}) private void initWebView() { mWebContent = (WebView) findViewById(R.id.news_detail_content); customViewContainer = (FrameLayout) findViewById(R.id.customViewContainer); mWebViewClient = new CustomWebViewClient(); mWebContent.setWebViewClient(mWebViewClient); mWebChromeClient = new MyWebChromeClient(); mWebContent.addJavascriptInterface(new JavascriptCallBack(), "Android"); mWebContent.setWebChromeClient(mWebChromeClient); WebSettings settings = mWebContent.getSettings(); settings.setJavaScriptEnabled(true); settings.setDomStorageEnabled(true); settings.setAppCachePath(AppUtils.getWebCachePath(this)); settings.setAllowFileAccess(true); settings.setAppCacheEnabled(true); settings.setCacheMode(WebSettings.LOAD_DEFAULT); settings.setDefaultTextEncodingName("UTF-8"); settings.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS); settings.setCacheMode(WebSettings.LOAD_DEFAULT); mWebContent.loadUrl(url); }