title: What is the difference from inflating an activity and inflating a view in android?
body: <p>I don't seem to understand if it's possible to inflate (include) an activity into another activity. I know i can inflate a layout xml, this works, but i am wondering if i can inflate an activity. For instance , i have class A that extends Activity and another class B that extends ListActivity. Can i include and use in class A, my class B?
  THis is what i have tried:</p>
  
  <p>Class A:</p>
  
  <pre><code>LayoutInflater inflater = (LayoutInflater) MyActivity.this
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
      // inflate list
      BActivity list = new BActivity();
  </code></pre>
  
  <p>Class B:</p>
  
  <pre><code>public class BActivity extends ListActivity {
    public void onCreate(Bundle bundle) {
      super.onCreate(bundle);
  
      List&lt;Model&gt; models= new ArrayList&lt;Model&gt;();
      models.add(new Model("John"));
      models.add(new Model("Cage"));
  
      setListAdapter(new MyAdapter(this, models));
      ListView list = getListView();
    }
  }
  </code></pre>
  
  <p>and in xml (the class A xml): (for where i want to see the list)</p>
  
  <pre><code> &lt;view class="com.test.BActivity"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" &gt;  &lt;/view&gt;
  </code></pre>
  
  <p>All of this throws errors :</p>
  
  <blockquote>
    <p>Error inflating class BActivity</p>
  </blockquote>
  
  <p>The activities are declared in the manifest.</p>
  
  <p>Do you know what i am doing wrong? this is not the correct way to inflate another activity? I am using Android 2.2 api 8.
  Thank you for your time.</p>