title: Using FragmentActivity throws InflateException
body: <p>Common Fragment to be used in 2 Activity's</p>
  
  <pre><code>public class Ads extends Fragment {
      private View rootView ;
      private MoPubView adView ;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          rootView = inflater.inflate(R.layout.ads, container, true) ;
          adView = (MoPubView) rootView.findViewById(R.id.adView) ;
          adView.setAdUnitId(LogoQuizUtil.MOPUB_AD_UNIT);     
          adView.loadAd();
          return rootView;
      }
  }
  </code></pre>
  
  <p>Fragment layout</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/ad_layout"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:gravity="bottom" &gt;
  
      &lt;com.mopub.mobileads.MoPubView
          android:id="@+id/adView"
          android:layout_width="fill_parent"
          android:layout_height="50dp"
          android:layout_marginTop="10dp"
          android:gravity="bottom" /&gt;    
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Other Layout where I include this fragment</p>
  
  <pre><code> &lt;fragment
      android:id="@+id/ads"
      android:name="myPackage.Ads"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:gravity="bottom" /&gt;
  </code></pre>
  
  <p>I get a dont get a exception when I call setContentView (R.layout.ads) the first time, when the second activity calls the fragementactivity (Ads) I get a exception at setContentView (R.id.ads).</p>
  
  <p>Exception I get is</p>
  
  <p><code>08-07 09:38:30.359: W/System.err(975): java.lang.RuntimeException: Unable to start activity ComponentInfo{mypackage/mypackage.SecondActivity}: android.view.InflateException: Binary XML file line #263: Error inflating class fragment</code></p>