title: No View Found For id in Android FragmentActivity with ListFragment
body: <p>I'm attempting to create a custom ListView. When I test my code, I receive the following error</p>
  
  <pre><code>03-09 19:21:10.425: E/AndroidRuntime(379): java.lang.RuntimeException: Unable to start      activity ComponentInfo{com.anomaly.punchlist/com.anomaly.punchlist.TeamActivity}: java.lang.IllegalArgumentException: No view found for id 0x7f08000c for fragment TeamListFragment{4067a358 #0 id=0x7f08000c}
  </code></pre>
  
  <p>I have referenced the following links prior to posting this question in addition to reading the Android Docs on Fragments, ListFragments, and ListViews.</p>
  
  <p>Link 1: <a href="https://stackoverflow.com/questions/10498258/fragmentactivity-oncreateview">FragmentActivity onCreateView</a>
  <br>
  Link 2: <a href="https://stackoverflow.com/questions/6301074/problem-using-listfragment-on-android">Problem using ListFragment on Android</a>
  <br>
  Link 3: <a href="https://stackoverflow.com/questions/7508044/android-fragment-no-view-found-for-id">Android Fragment no view found for ID?</a>
  <br>
  Link 4: <a href="https://stackoverflow.com/questions/10481414/android-listfragment-is-to-confusing">Android ListFragment is to confusing</a>
  <br> 
  Link 5: <a href="https://stackoverflow.com/questions/10027202/how-update-listview-in-listfragment-from-fragmentactivity">How update ListView in ListFragment from FragmentActivity?</a>
  <br>
  Link 6: <a href="https://stackoverflow.com/questions/9053671/populate-listfragments-with-a-custom-view">Populate ListFragments with a custom view?</a></p>
  
  <p>I have class TeamActivity which extends FragmentActivity and TeamListFragment which extends ListFragment and implements LoaderManager.LoaderCallbacks. Please see code below:</p>
  
  <p>TeamActivity.java</p>
  
  <pre><code>package com.anomaly.punchlist;
  
  import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentTransaction;
  
  public class TeamActivity extends FragmentActivity {
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      FragmentManager fragmentManager = getSupportFragmentManager();
      FragmentTransaction fragmentTransaction =  fragmentManager.beginTransaction();
      TeamListFragment teamListFragment = new TeamListFragment();
      fragmentTransaction.add(R.id.android_teamList, teamListFragment);
      fragmentTransaction.commit();       
     }
  
   }
  </code></pre>
  
  <p>TeamListFragment.java</p>
  
  <pre><code>package com.anomaly.punchlist;
  
      import android.database.Cursor;
      import android.os.Bundle;
      import android.support.v4.app.ListFragment;
      import android.support.v4.app.LoaderManager;
      import android.support.v4.content.CursorLoader;
      import android.support.v4.content.Loader;
  import android.support.v4.widget.CursorAdapter;
  import android.support.v4.widget.SimpleCursorAdapter;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ListView;
  
  import com.anomaly.punchlist.contentprovider.basecolumns.TeamBaseColumns.Team;
  import com.j256.ormlite.logger.Logger;
  import com.j256.ormlite.logger.LoggerFactory;
  
  public class TeamListFragment extends ListFragment implements LoaderManager.LoaderCallbacks&lt;Cursor&gt; {
  
      private static Logger logger = LoggerFactory.getLogger(TeamListFragment.class);
      private ListView listView;
      private SimpleCursorAdapter adapter;
      private static final int TEAM_LOADER_ACTIVITY = 0x01;
      private static final String[] PROJECTION = new String[] { "project_manager_id", "contact_id", "project_id" };
      private static String SELECTION = "contact_id = ? AND project_id = ?";
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          try {
              super.onCreate(savedInstanceState);
              int[] uiBindTo = { R.id.text1 };
              getLoaderManager().initLoader(TEAM_LOADER_ACTIVITY, null, this);
              adapter = new SimpleCursorAdapter(getActivity().getApplicationContext(), R.layout.team, null, null, uiBindTo, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER);
  
          } catch (Exception e) {
              logger.error(e.getMessage());
              new RuntimeException("RuntimeException occurred in onCreate() method of TeamActivity." + e);
          }
      }
  
      @Override
      public void onListItemClick(ListView l, View v, int position, long id) {
          super.onListItemClick(l, v, position, id);
      }
  
      @Override
      public Loader&lt;Cursor&gt; onCreateLoader(int arg0, Bundle bundle) {
  
          String contactId = new String();
          String projectId = new String();
          CursorLoader cursorLoader = null;
  
          if (bundle != null) {
              contactId = bundle.getString("contact_id");
              projectId = bundle.getString("project_id");
  
          }
          String[] selectionArgs = { contactId + ", " + projectId };
          cursorLoader = new CursorLoader(getActivity(), Team.CONTENT_URI, PROJECTION, SELECTION, null, null);
          return cursorLoader;
      }
  
      @Override
      public void onLoadFinished(Loader&lt;Cursor&gt; loader, Cursor cursor) {
          adapter.swapCursor(cursor);
          setListShown(true);
  
      }
  
      @Override
      public void onLoaderReset(Loader&lt;Cursor&gt; cursor) {
          adapter.swapCursor(null);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          onCreate(savedInstanceState);
          View teamView = inflater.inflate(R.layout.team, container, false);
          return teamView;
      }
  
      @Override
      public void onViewCreated(View view, Bundle savedInstanceState) {
          listView = getListView();
          listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
          setListAdapter(adapter);
          setListShown(true);
      }
  
  }
  </code></pre>
  
  <p>In addition to the code above, I have the following custom layout.</p>
  
  <p>team.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:paddingLeft="8dp"
      android:paddingRight="8dp" &gt;
  
  
      &lt;ListView
          android:id="@+id/android:teamList"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1"
          android:background="@color/grey2"
          android:divider="@color/blue2"
          android:dividerHeight="1dp"
          android:drawSelectorOnTop="false" /&gt;
  
      &lt;TextView
          android:id="@id/android:empty"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="#FF0000"
          android:text="No data" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>