【发布时间】:2018-06-11 18:40:50
【问题描述】:
应用程序未连接到互联网。我有
<uses-permission android:name="android.permission.INTERNET" />
在我的清单中,我检查了模拟器上的其他应用程序,例如 youtube 和 google 搜索工作,但该应用程序无法加载页面。这是我的主要 java 文件。
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView myWebview ;
myWebview = (WebView) this.findViewById(R.id.webz);
myWebview.loadUrl("https://en.wikipedia.org/");
}
}
这是我的主要活动
<?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="com.example.hoda.myapplication.MainActivity">
<WebView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/webz"></WebView>
</android.support.constraint.ConstraintLayout>
这是我得到的错误
[ERROR:gl_surface_egl.cc(289)] eglChooseConfig failed with error EGL_SUCCESS
【问题讨论】:
-
按照这里的建议重启模拟器link
-
我有下一个错误 [ERROR:gl_surface_egl.cc(467)] eglChooseConfig 因错误 EGL_SUCCESS 失败。有什么问题?
标签: android network-connection