Reputation: 31
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?
Upvotes: 3
Views: 3096
Reputation: 14408
Change
WebView mWebView = new WebView(getApplicationContext());
to
WebView mWebView = new WebView(this);
Upvotes: 3