title: WebView is not opening webpages but browser is (ERROR: Web page not available)
body: <p>I'm creating an Android application (Android 2.3.3) that has a header, a footer and a WebView between both. The problem is that the WebView is not opening any webpage. (NOTE: I'm running the app on an emulator).</p>
  
  <p>I tried opening webpages using the Android browser and the webpages are opened correctly. I also tried:</p>
  
  <pre><code>Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
  startActivity(intent);
  </code></pre>
  
  <p>And the code works correctly (opens the page in the browser).</p>
  
  <p>I've been working with www.google.com and with a domain of my own, I've also been working with the ip adress of both web pages (for google 72.14.204.147 and for my own, the ip of my own dev server).</p>
  
  <p>Also, before the most popular answer is written, I already have <code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;</code> before the application tag.</p>
  
  <p>I'm adding the code before anyone asks for it:</p>
  
  <p>The activity java file:</p>
  
  <pre><code>public class MyActivity extends Activity {
  
  //Global Variables
  WebView mainWebView;
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      loadActivityViews();
  
      mainWebView.getSettings().setJavaScriptEnabled(true);
      mainWebView.loadUrl("www.google.com");
      mainWebView.setWebViewClient(new MyWebViewClient());
  }
  
  /** Loads all global views of the Activity */
  private void loadActivityViews(){
      mainWebView = (WebView) findViewById(R.id.index_main_web_view);
  } 
  
  //Internal Classes
  
  /*
   * MyWebView Class
   * 
   * Forces links to open in the same webView
   * Handles the back button.
   * */
  
  public class MyWebViewClient extends WebViewClient {
  
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
          view.loadUrl(url);
          return true;
      }
  
      @Override
      public boolean shouldOverrideKeyEvent(WebView view, KeyEvent event) {
          if ((event.getKeyCode() == KeyEvent.KEYCODE_BACK) &amp;&amp; view.canGoBack()) {
              view.goBack();
              return true;
          }
  
          return super.shouldOverrideKeyEvent(view, event);
      }
  }
  }
  </code></pre>
  
  <p>The android Manifest:
  (NOTE: it has "android.permission.INTERNET" before the application tag)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="pixable.android"
      android:versionCode="1"
      android:versionName="1.0" &gt;
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
      &lt;uses-sdk android:minSdkVersion="10" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  
  
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name" &gt;
  
          &lt;activity
              android:label="@string/app_name"
              android:name=".MyActivity"
              android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" &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>the main.xml (I don;t think its important, but I'm adding it just in case)</p>
  
  <pre><code>&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;RelativeLayout
          android:id="@+id/index_main_layout"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:background="#FFFFFF" &gt;
  
          &lt;RelativeLayout
              android:id="@+id/index_header"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_alignParentLeft="true"
              android:layout_alignParentTop="true"
              android:background="#000000" &gt;
  
              ... My header butons ...
  
          &lt;/RelativeLayout&gt;
  
          &lt;WebView
              android:id="@+id/index_main_web_view"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_alignParentLeft="true"
              android:layout_below="@+id/index_header"
              android:layout_above="@+id/index_botom_layout" /&gt;
  
          &lt;LinearLayout
              android:id="@+id/index_botom_layout"
              android:layout_width="fill_parent"
              android:layout_height="50px"
              android:layout_alignParentBottom="true"
              android:background="#000000"
              android:orientation="horizontal" &gt;
  
              ... My Footer Butons ...
  
          &lt;/LinearLayout&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>