I created one Android project with simple web browsing.
I am trying to open Google. But the emulator screen says that Google is unavailable.
I added permission to use the Internet to the manifest file. Even I can access Google from the Emulator browser. Only in the application I can not access. Nothing is printed in the journal either.
Please, help.
<?xml version="1.0" encoding="utf-8"?> <WebView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.loadUrl("http://www.google.com"); mWebView.setWebViewClient(new HelloWebViewClient()); } private class HelloWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } <uses-permission android:name="android.permission.INTERNET" />
source share