E/libEGL: validate_display:99 错误 3008 (EGL_BAD_DISPLAY) API 24 或更高版本
2022-09-01 04:02:24
当我使用 API 为 24 或更高的设备时,我收到此错误:
E/libEGL: validate_display:99 错误 3008 (EGL_BAD_DISPLAY)
XML 代码 = (activity_main.xml)
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="charliedek.test.MainActivity">
<WebView
android:id = "@+id/webView"
android:layout_width="368dp"
android:layout_height="495dp"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp" />
</android.support.constraint.ConstraintLayout>
Java code = (MainActivity.java)
package charliedek.test;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String myurl="file:///android_asset/index.html";
WebView view = (WebView) this.findViewById(R.id.webView);
view.getSettings().setJavaScriptEnabled(true);
view.loadUrl(myurl);
}
}
HTML 代码 = (索引.html)
<html>
<body>
<button><a href = "second.html"> Go To Second Page</a></button>
</body>
</html>
HTML 代码 = (秒.html)
<html>
<body>
<button><a href = "index.html"> Go To First Page</a></button>
</body>
</html>
每当单击按钮时,应用程序都会崩溃!任何帮助将不胜感激。