title: Android: InflateException on composite component
body: <p>I'm creating a pretty complex composite component which throws an InflateException with an unknown cause. I was able to replicate the error in a simplified version below, which is just a component with two text views. Any help in identifying the error or tracking it down would be appreciated.</p>
  
  <p><strong>composite_component.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;com.cc.CompositeComponent 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"&gt;
      &lt;TextView
          android:text="One"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"/&gt;
      &lt;TextView
          android:text="Two"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"/&gt;
  &lt;/com.cc.CompositeComponent&gt;
  </code></pre>
  
  <p><strong>CompositeComponent.java</strong></p>
  
  <pre><code>package com.cc;
  
  import android.app.Activity;
  import android.content.Context;
  import android.util.AttributeSet;
  import android.widget.LinearLayout;
  
  public class CompositeComponent extends LinearLayout {
  
      public CompositeComponent(Context context) {
      super(context);
      }
  
      public CompositeComponent(Context context, AttributeSet attributes){
          super(context, attributes);
      }
  
      protected void onFinishInflate() {
          super.onFinishInflate();
          ((Activity)getContext()).getLayoutInflater().inflate(R.layout.composite_component, this);
      }
  }
  </code></pre>
  
  <p><strong>CompositeActivity.java</strong></p>
  
  <pre><code>package com.cc;
  
  import android.app.Activity;
  import android.os.Bundle;
  
  public class CompositeActivity extends Activity {
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.composite_component);
      }
  }
  </code></pre>
  
  <p><strong>AndroidManifest.xml</strong></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.cc"
      android:versionCode="1"
      android:versionName="1.0"&gt;
  &lt;uses-sdk android:minSdkVersion="8" /&gt;
  
  &lt;application android:icon="@drawable/icon" android:label="CompositeComponent"&gt;
      &lt;activity android:name="CompositeActivity"
                android:label="CompositeComponent"&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;
  </code></pre>
  
  <p></p>