My app is using a WebView to display a long text
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WebView mWebView = new WebView(getApplicationContext());
setContentView(mWebView);
String s = getHtml(); //get a long html from a file
webView.loadDataWithBaseURL("file:///android_asset/", s, "text/html", "UTF-8", null);
}
the app works well on older versions of Android,
but when running on KitKat, this error appears in the logcat when the WebView is created or destroyed:
libGLESv2(21582): HWUI Protection: wrong calling from app context F:ES3-glDeleteShader
I have read "Migrating to WebView in Android 4.4" but I cannot solve the problem.
How do I fix this?
Change
WebView mWebView = new WebView(getApplicationContext());
to
WebView mWebView = new WebView(this);
add
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With