In my Android application I'm using a WebView
, but this is very slow for some content so it stops being useful. I have tried to update the WebView
of the testing device but it has not contributed anything. I have also tried the following lines and none has served:
In AndroidManifest
:
android:hardwareAccelerated="true"
In MainActivity
:
webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// chromium, enable hardware acceleration
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
} else {
// older android version, disable hardware acceleration
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
I would like to know if there is any other way to optimize the use of WebView
since the previous ones have not helped me.