title: Android webview tutorial not working
body: <p>This is the manifest file, I added the permission to go on Internet.</p>
  
  <p>Manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.a2"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="19" /&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="com.example.a2.MainActivity"
              android:label="@string/app_name" &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>This is the xml file for creating the id webview.</p>
  
  <p>Fragment XML:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context="com.example.a2.MainActivity$PlaceholderFragment" &gt;
  
      &lt;WebView
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:id="@+id/webview" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Activity XML:</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.a2.MainActivity"
      tools:ignore="MergeRootFrame" /&gt;
  </code></pre>
  
  <p>And this is the code to get it running on my device</p>
  
  <p>Java Code:</p>
  
  <pre><code>public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          /*
          if (savedInstanceState == null) {
              getSupportFragmentManager().beginTransaction()
                      .add(R.id.container, new PlaceholderFragment()).commit();
          }*/
          WebView webPage = (WebView) findViewById(R.id.webview);
          webPage.getSettings().setJavaScriptEnabled(true);
          webPage.loadUrl("http://www.google.com");
      }
  
  }
  </code></pre>
  
  <p>Exception:</p>
  
  <pre><code>FATAL EXCEPTION: main
  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.a2/com.example.a2.MainActivity}: java.lang.NullPointerException
  </code></pre>