title: Android unable to start activity, error inflating class?
body: <p>I'm new to android. I have some java knowledge, and I'm using Eclipse. 
  At the moment I'm trying to display a map within a tab, and am looking at tutorials/code to help me. :)</p>
  
  <p>I've seen a few questions asking about this error, but I can't figure out what I'm doing wrong, still. 
  I'm using code from here: <a href="http://vkroz.wordpress.com/2009/07/03/programming-android-%E2%80%93-map-view-within-tab-view/" rel="noreferrer">http://vkroz.wordpress.com/2009/07/03/programming-android-%E2%80%93-map-view-within-tab-view/</a></p>
  
  <p>Am I just missing something obvious? </p>
  
  <p>The value of the runtime exception e: </p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: ... android.view.InflateException: Binary XML file line #24: Error inflating class &lt;unknown&gt;
  </code></pre>
  
  <p>Line 24 is just <code>&lt;/LinearLayout&gt;</code> </p>
  
  <p>The whole of main.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@android:id/tabhost"
      android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
  
      &lt;LinearLayout android:orientation="vertical"
          android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
  
          &lt;TabWidget android:id="@android:id/tabs"
              android:layout_width="fill_parent" android:layout_height="wrap_content"/&gt;
  
          &lt;FrameLayout android:id="@android:id/tabcontent"
                  android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
  
                  &lt;RelativeLayout android:id="@+id/emptylayout1" android:orientation="vertical"
                      android:layout_width="fill_parent" android:layout_height="fill_parent"/&gt;
  
                  &lt;TextView android:id="@+id/textview2"
                      android:layout_width="fill_parent" android:layout_height="fill_parent"
                      android:text="Details Details Details Details"/&gt;
  
          &lt;/FrameLayout&gt;
      &lt;/LinearLayout&gt; 
  &lt;/TabHost&gt;
  </code></pre>
  
  <p>The rest of my code is the same as linked, but I'll paste it here too. </p>
  
  <p>MapInTabActivity.java</p>
  
  <pre><code>package com.test.mapintab;
  
  import android.app.TabActivity;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  import android.widget.FrameLayout;
  import android.widget.TabHost;
  import android.widget.TabHost.TabSpec;
  
  public class MapInTabActivity extends TabActivity {
  
      TabHost mTabHost;
      FrameLayout mFrameLayout;
  
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          mTabHost = getTabHost();
          TabSpec tabSpec = mTabHost.newTabSpec("tab_test1");
          tabSpec.setIndicator("Map");
          Context ctx = this.getApplicationContext();
          Intent i = new Intent(ctx, MapInTabActivity.class);
          tabSpec.setContent(i);
  
          mTabHost.addTab(tabSpec);
          mTabHost.addTab(mTabHost.newTabSpec("tab_test2").setIndicator("Details").setContent(R.id.textview2));
          mTabHost.setCurrentTab(0);
  
      }
  
  }
  </code></pre>
  
  <p>MapTabView.java:</p>
  
  <pre><code>package com.test.mapintab;
  
  import android.os.Bundle;
  
  import com.google.android.maps.MapActivity;
  
  public class MapTabView extends MapActivity{
  
      @Override
      protected void onCreate(Bundle icicle){
          super.onCreate(icicle);
          setContentView(R.layout.maptabview);
      }
  
      @Override
      protected boolean isRouteDisplayed(){
          return false;
      }
  
  }
  </code></pre>
  
  <p>maptabview.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/maptablayout"
      android:orientation="vertical"
      android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
  
      &lt;com.google.android.maps.MapView android:id="@+id/mapview"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:clickable="true"            
          android:apiKey="0HRMcD5o6WrBVhmwbWpeyeavZ67PXWOvJeeCx2g"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <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.test.mapintab"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk android:minSdkVersion="8" /&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"&gt;&lt;/uses-permission&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"&gt;&lt;/uses-permission&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"&gt;&lt;/uses-permission&gt;
  
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name" &gt;
          &lt;uses-library android:name="com.google.android.maps"/&gt;
  
          &lt;activity
              android:name=".MapInTabActivity" 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;activity android:name=".MapTabView" android:label="@string/mapview_name"&gt;
             &lt;intent-filter&gt;
                &lt;category android:name="android.intent.category.EMBED"&gt;&lt;/category&gt;
                &lt;action android:name="android.intent.action.MAIN"&gt;&lt;/action&gt;
             &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>And the rest of logcat (I think the important part was the bit I pointed out at the top, but maybe there's something else I don't know about). </p>
  
  <pre><code>02-05 09:49:21.239: W/dalvikvm(357): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
  02-05 09:49:22.616: E/AndroidRuntime(357): FATAL EXCEPTION: main
  02-05 09:49:22.616: E/AndroidRuntime(357): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: android.view.InflateException: Binary XML file line #24: Error inflating class &lt;unknown&gt;
  02-05 09:49:22.616: E/AndroidRuntime(357):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
  02-05 09:49:22.616: E/AndroidRuntime(357):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  02-05 09:49:22.616: E/AndroidRuntime(357):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  02-05 09:49:22.616: E/AndroidRuntime(357):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
  02-05 09:49:22.616: E/AndroidRuntime(357):  at android.os.Handler.dispatchMessage(Handler.java:99)
  02-05 09:49:22.616: E/AndroidRuntime(357):  at android.os.Looper.loop(Looper.java:123)
  02-05 09:49:22.616: E/AndroidRuntime(357):  at android.app.ActivityThread.main(ActivityThread.java:4627)
  02-05 09:49:22.616: E/AndroidRuntime(357):  at java.lang.reflect.Method.invokeNative(Native Method)
  02-05 09:49:22.616: E/AndroidRuntime(357):  at java.lang.reflect.Method.invoke(Method.java:521)
  02-05 09:49:22.616: E/AndroidRuntime(357):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  02-05 09:49:22.616: E/AndroidRuntime(357):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  02-05 09:49:22.616: E/AndroidRuntime(357):  at dalvik.system.NativeStart.main(Native Method)
  02-05 09:49:22.616: E/AndroidRuntime(357): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.mapintab/com.test.mapintab.MapInTabActivit
  </code></pre>