title: libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY) while load WebView
body: <p>This is the code of <code>WebViewActivity</code> which is used for loading <code>WebView</code>.  I tried the below code.</p>
  
  <pre><code>public class WebviewActivity extends Activity {
  WebView webView;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_webview);
  
      webView = (WebView) findViewById(R.id.webview);
      setupWebView();
      webView.loadUrl("http://www.Example.com/");
  }
  private void setupWebView() {
      webView.getSettings().setJavaScriptEnabled(true);
      webView.setWebViewClient(new WebViewClient() {
          @Override
          public void onPageFinished(WebView view, String url) {
              webView.loadUrl("javascript:MyApp.resize(document.body.getBoundingClientRect().height)");
              super.onPageFinished(view, url);
          }
      });
      webView.addJavascriptInterface(this, "MyApp");
  }
  
  @JavascriptInterface
  public void resize(final float height) {
     WebviewActivity.this.runOnUiThread(new Runnable() {
          @Override
          public void run() {
              webView.setLayoutParams(new RelativeLayout.LayoutParams(getResources().getDisplayMetrics().widthPixels, (int) (height * getResources().getDisplayMetrics().density)));
          }
      });
     }
  
  
     }
  </code></pre>
  
  <p>when loading the <code>WebView</code> I got the error <code>libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)</code></p>