title: Basic fragment application is not working
body: <p>I am working on a basic fragment application from the tutorials. All I am doing is adding fragment layout and inflating it. I have attached a class with the fragment as mentioned in the tutorials, but when I run the application, it fails with message "Unfortunately, 'App' has stopped".</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>AndroidManifest.xml</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.fragments"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="11"
      android:targetSdkVersion="21" /&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=".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;activity android:name=".ArticleFragment"&gt;&lt;/activity&gt;
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"&gt;
  
      &lt;fragment android:name="com.example.fragments.ArticleFragment"
            android:id="@+id/article_fragment"
            android:layout_weight="2"
            android:layout_width="0dp"
            android:layout_height="match_parent" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>MainActivity.Java</p>
  
  <pre><code>package com.example.fragments;
  
  import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  
  public class MainActivity extends  FragmentActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      }
  }
  </code></pre>
  
  <p>ArticleFragment.Java</p>
  
  <pre><code>package com.example.fragments;
  import android.app.Fragment;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  public class ArticleFragment extends Fragment {
  
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
      // Inflate the layout for this fragment
     return inflater.inflate(R.layout.activity_main, container, false);
  }
  
  }
  </code></pre>