0
private class HelloWebViewClient extends WebViewClient {
    @Override

    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        view.loadUrl(url);
    return true;
    }
}

WebView w=(WebView) dialog.findViewById(R.id.webView);
WebView.enablePlatformNotifications();
w.getSettings().setJavaScriptEnabled(true); 
w. getSettings().setJavaScriptCanOpenWindowsAutomatically (false);
w. getSettings().setPluginsEnabled (true);
w.loadUrl("http://www.agaraadhi.com");
w.setWebViewClient(new HelloWebViewClient());

I'm trying to load a web page into the web view.I get web page not available error.I can access the page from the default browser.I set the permission in manifest.But the below code works fine.

Uri uri = Uri.parse("http://www.agaraadhi.com");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Wessel Kranenborg
  • 1,400
  • 15
  • 38
jananni
  • 1
  • 1
  • Check if you are able to access the web page from emulator browser. Also check the proxy settings in emulator. – Swapna May 28 '11 at 07:02
  • I can access the page from emulator browser. Also this code Uri uri = Uri.parse("http://www.agaraadhi.com"); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); works properly.But m not able to load the page into webview. – jananni May 28 '11 at 07:04
  • These two tags must be before application tag in manifest. – jananni May 28 '11 at 09:00
  • possible duplicate of ["Web page not available"](http://stackoverflow.com/questions/23862486/web-page-not-available) – Richard Le Mesurier Jun 09 '15 at 16:16

1 Answers1

1

Do you have the permission android.permission.INTERNET enabled in AndroidManifest.xml? E.g.

<uses-permission android:name="android.permission.INTERNET"/>

Regarding one of the comments above, I haven't heard of WebViews requiring the ACCESS_NETWORK_STATE permission, and have had them working without it, but perhaps the functionality is automatically used for something optional if available(?)

Sven Viking
  • 2,660
  • 21
  • 34