title: WebView page not available - Android
body: <p>I have a basic <code>WebView</code> application that should display www.google.com. Though the website can be accessed through the in-built browser, I am not able to do so from the <code>WebView</code>. I have gone through a large number of questions on various forums and incorporated all suggestions, but nothing seems to have worked. I have ensured:<br>
  1. The <code>uses-permission</code> tag for allowing internet access is a child of the <code>manifest</code> tag.<br>
  2. Enabled javascript for the WebView.<br>
  The manifest file:  </p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.sriram.hellowebview"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt;
  
      &lt;uses-sdk
          android:minSdkVersion="7"
          android:targetSdkVersion="15" /&gt;
  
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name=".helloWebview"
              android:label="@string/title_activity_hello_webview" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;  
  </code></pre>
  
  <p>Layout:  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical"&gt;
  
     &lt;WebView
         android:id="@+id/helloWebview"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
       /&gt;
  &lt;/LinearLayout&gt;  
  </code></pre>
  
  <p>Code:  </p>
  
  <pre><code>/* Program to create sample webview.
   * Steps:
   * 1. Create webview.
   * 2. Show some website in it.
   * 3. Show some transitions as well.
   */
  
  package com.sriram.hellowebview;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.Menu;
  import android.webkit.WebView;
  
  public class helloWebview extends Activity {
  
      WebView myWebview;
      String url = "www.google.com";
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_hello_webview);
  
          Log.v(this.toString(), "Starting activity.");
  
          myWebview = (WebView) findViewById(R.id.helloWebview);
  
          Log.v(this.toString(), "Getting settings.");
          myWebview.getSettings().setJavaScriptEnabled(true);
  
          Log.v(this.toString(), "Loading URL now.");
          myWebview.loadUrl(url);
          Log.v(this.toString(), "Loaded URL.");
  
          //open all links within the same webview.
          //myWebview.setWebViewClient(new WebViewClient());
          //Log.v(this.toString(), "All done here.");
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          getMenuInflater().inflate(R.menu.activity_hello_webview, menu);
          return true;
      }
  }
  </code></pre>