JavaScript doesn't work on ICS

前端 未结 3 923
我在风中等你
我在风中等你 2021-01-15 11:14

I am working on EPUB reader for the company using JavaScript, the application runs well on Android 2.2, but when i try it on ICS & HoneyCom, the JavaScript doesn\'t work

3条回答
  •  一生所求
    2021-01-15 12:13

    u can add one property android:hardwareAccelerated="true" in application tag of your manifest.xml as well u can add some settings in on create

    wvMain.getSettings().setSupportZoom(true);
          wvMain.getSettings().setBuiltInZoomControls(true);
          wvMain.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
          wvMain.setScrollbarFadingEnabled(true);
          wvMain.getSettings().setLoadsImagesAutomatically(true);
          wvMain.getSettings().setJavaScriptEnabled(true);
          wvMain.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
           wvMain.getSettings().setPluginsEnabled(true);
             wvMain.getSettings().setSupportZoom(false);     
    
             wvMain.getSettings().setCacheMode(wvMain.getSettings().LOAD_NO_CACHE);
             webSettings8.setPluginState(WebSettings.PluginState.ON);
             wvMain.setWebViewClient(new WebViewClient());
             wvMain.addJavascriptInterface(this, "Android");
             wvMain.getSettings().setSupportMultipleWindows(true);
             wvMain.getSettings().setPluginsEnabled(true);
             wvMain.getSettings().setUseWideViewPort(true);
             wvMain.getSettings().setLoadWithOverviewMode(true);
    

    i hope this helps.but note, hardwareaccelerated property supports after 3.0.

提交回复
热议问题