title: Android - Every link in webview crashes app
body: <p>I'm building an app with a bunch of fragments swapped around using an ActionBarSherlock tab bar. One of the fragments is just a WebView which displays the mobile version of their online shop.</p>
  
  <p>The website for the shop loads OK for the home page, but as soon as I tap on any link, the app crashes (when testing on ICS, 4.0.3).</p>
  
  <p>This is the code I'm using to setup the web view:</p>
  
  <pre><code>    // Set the web view
      WebView webView = (WebView)rootView.findViewById(R.id.shop_webview);
      webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
      WebSettings webViewSettings = webView.getSettings();
      webViewSettings.setJavaScriptEnabled(true);
      webView.loadUrl(shopUrl);
  </code></pre>
  
  <p>This is the error that appears in the LogCat when the app crashes:</p>
  
  <pre><code>10-26 21:39:05.565: ERROR/AndroidRuntime(11021): FATAL EXCEPTION: main
      java.lang.NullPointerException
      at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:876)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:137)
      at android.app.ActivityThread.main(ActivityThread.java:4507)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:511)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
      at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Manifest (as requested in comments), note that the activity that displays the webview is a fragment managed in the RootActivity:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="au.com.client.android" android:versionCode="1" android:versionName="1.0"&gt;
      &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15"/&gt;
      &lt;uses-feature android:name="android.hardware.touchscreen" android:required="true"/&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
      &lt;uses-permission android:name="android.permission.CALL_PHONE"/&gt;
  
      &lt;application android:name=".App" android:label="@string/app_name" android:icon="@drawable/app_icon" android:logo="@drawable/logo"&gt;
          &lt;activity android:name="au.com.client.whitelabel.android.LaunchActivity" android:label="@string/app_name" android:theme="@style/Theme.Client" android:screenOrientation="portrait"&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;uses-library android:name="com.google.android.maps"/&gt;
          &lt;activity android:name="au.com.client.whitelabel.android.RootActivity" android:label="@string/app_name" android:theme="@style/Theme.Client" android:screenOrientation="portrait" /&gt;
          &lt;activity android:name="au.com.client.whitelabel.android.SettingsActivity" android:label="@string/app_name" android:screenOrientation="portrait" /&gt;
          &lt;activity android:name="au.com.client.whitelabel.android.LoginActivity" android:windowSoftInputMode="stateHidden" android:configChanges="orientation|keyboardHidden" android:theme="@style/Theme.Client" android:screenOrientation="portrait" /&gt;
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Not much to go on, I know. I'm afraid that the online shop is using some sort of framework for the mobile site that relies on functionality offered by the full browsers on the phones, but isn't supported in the little WebView. Thanks in advance for any help...</p>