title: Issue with ListFragment Displaying Data
body: <p>I have a class that is displaying a list of owner using ListFragment. When a user clicked on an owner, it supposed to replace the bottom fragment with a new fragment that would list the owner’s car. The issue is that it kept throwing an exception <strong>No view found for id 0x7f090013</strong> even though I created a view for it. What am I doing wrong here?</p>
  
  <p>//This is the <code>onListItemClick</code> where I am calling to replace the other fragment (Full code will be posted at the end.)</p>
  
  <pre><code>@Override
  public void onListItemClick(ListView l, View v, int position, long id) {
      // TODO Auto-generated method stub
      //super.onListItemClick(l, v, position, id);
      int search = 0;
      Owner a = (Owner) getListView().getItemAtPosition(position);
      String name = a.getFirstName();
      String lName = a.getLastName();
      String Id = a.getCarId();
  
      FragmentManager mFragment = getChildFragmentManager();
      FragmentTransaction ft = mFragment.beginTransaction();
      CarDetail cDetail = new CarDetail();
      cDetail.SearchParameters(Integer.parseInt(Id));
      ft.replace(R.id.fCarDetail, cDetail);
      ft.addToBackStack(null);
      ft.commit();    
  }
  </code></pre>
  
  <p>//This is the car Detail Fragment</p>
  
  <pre><code>import android.os.AsyncTask;
  import android.os.Bundle;
  import android.support.v4.app.ListFragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  
  public class CarDetail extends ListFragment {
     private ListView lCars;
     private ArrayList&lt;Car&gt; listCar = new ArrayList&lt;Car&gt;();
     private CarAdapter carAdapter;
      private int carId = 0;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View v1 = inflater.inflate(R.layout.customize_layout,container,false);
          lCars = (ListView) v1.findViewById(android.R.id.list);
          return v1;
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);
          lCars.setAdapter(carAdapter);
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          carAdapter = new CarAdapter(getActivity(), R.layout.car_detail, listCar);
          if(carId &gt; 0)
          {
             new CarAsyncTask(carId).execute();
                       //As soon as it done with the on create, it throw the exception. 
          }
      }
  
      public void SearchParameters(int id) {
          carId = id;
      }
  
  
  
  
      private class CarAsyncTask extends AsyncTask&lt;Integer, Void, List&lt;Car&gt;&gt; {
          public int id =0;
  
  
          public CarAsyncTask(int carId) {
              id = carId;
          }
  
          @Override
          protected List&lt;Car&gt; doInBackground(Integer... params) {
              //List&lt;Car&gt; item = null;
              List&lt;Car&gt; item = new ArrayList&lt;Car&gt;();
              item.add(new Car("Chevy","Caprice","2002", 1));
              item.add(new Car("Chevy","Malibu","2014", 2));
              item.add(new Car("Dodge","Stratus","2002", 3));
              item.add(new Car("Saturn","L300","2004", 4));
  
              return item;
          }
  
  
  
          @Override
          protected void onPreExecute() {
              // TODO Auto-generated method stub
              super.onPreExecute();
              listCar.clear();
              carAdapter.clear();
  
          }
  
          @Override
          protected void onPostExecute(List&lt;Car&gt; result) {
              super.onPostExecute(result);
              for(Car c: result)
              {
                  if(c.getID() == carId)
                  {
                      carAdapter.add(c);
                      carAdapter.notifyDataSetChanged();
                  }
              }
          }
  
      }
  
  }
  </code></pre>
  
  <p>//car_detail.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" &gt;
  
     &lt;TextView
          android:id="@+id/tvMake"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="test" /&gt;
  
      &lt;TextView
          android:id="@+id/tvModel"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="make" /&gt;
  
      &lt;TextView
          android:id="@+id/tvYear"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="year" /&gt;
  
       &lt;TextView
          android:id="@+id/tvID"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="ID" /&gt;
  
  &lt;/LinearLayout&gt;
  //the customize layout
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
           android:orientation="vertical"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:paddingLeft="8dp"
           android:paddingRight="8dp"&gt;
  
       &lt;ListView android:id="@id/android:list"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:layout_weight="1"
                 android:background="#FFFF00"
                 android:drawSelectorOnTop="false"/&gt;
  
       &lt;TextView android:id="@id/android:empty"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:background="#FF00FF"
                 android:text="No data"/&gt;
   &lt;/LinearLayout&gt;
  Exception:
  
  08-22 21:00:21.051: E/AndroidRuntime(907): FATAL EXCEPTION: main
  08-22 21:00:21.051: E/AndroidRuntime(907): java.lang.IllegalArgumentException: No view found for id 0x7f090013 (com.mb.carlovers:id/fCarDetail) for fragment CarDetail{40d97200 #0 id=0x7f090013}
  08-22 21:00:21.051: E/AndroidRuntime(907):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:919)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1460)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at android.os.Handler.handleCallback(Handler.java:725)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at android.os.Handler.dispatchMessage(Handler.java:92)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at android.os.Looper.loop(Looper.java:137)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at android.app.ActivityThread.main(ActivityThread.java:5041)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at java.lang.reflect.Method.invokeNative(Native Method)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at java.lang.reflect.Method.invoke(Method.java:511)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  08-22 21:00:21.051: E/AndroidRuntime(907):  at dalvik.system.NativeStart.main(Native Method)
  08-22 21:00:21.172: W/ActivityManager(290):   Force finishing activity com.mb.carlovers/.People
  08-22 21:00:21.231: W/WindowManager(290): Failure taking screenshot for (237x148) to layer 21015
  08-22 21:00:21.631: E/SurfaceFlinger(37): ro.sf.lcd_density must be defined as a build property
  08-22 21:00:21.751: W/ActivityManager(290): Activity pause timeout for ActivityRecord{40f05be8 u0 com.mb.carlovers/.People}
  08-22 21:00:21.821: D/dalvikvm(290): GC_CONCURRENT freed 752K, 18% free 5916K/7192K, paused 74ms+104ms, total 515ms
  08-22 21:00:31.265: W/ActivityManager(290): Launch timeout has expired, giving up
  </code></pre>
  
  <p>//Below is the OwnerDetail Code</p>
  
  <pre><code>package com.mb.carlovers;
  import java.util.ArrayList;
  import java.util.List;
  
  import com.mb.carlovers.adapter.OwnerAdapter;
  
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentTransaction;
  import android.support.v4.app.ListFragment;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ListView;
  
  public class OwnerDetail extends ListFragment {
     private ListView mListView;
     private ArrayList&lt;Owner&gt; listItem = new ArrayList&lt;Owner&gt;();
     private OwnerAdapter ownerAdapter;
     private String[] searchParameter = null;
  
     public void SearchParameters(String[] parameters)
     {
         searchParameter = parameters;
     }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
          View v1 = inflater.inflate(R.layout.customize_layout,container, false);
          mListView = (ListView) v1.findViewById(android.R.id.list);
          return v1;
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) 
      {
          super.onActivityCreated(savedInstanceState);
          mListView.setAdapter(ownerAdapter);
        //  ownerAdapter.notifyDataSetChanged();
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          ownerAdapter = new OwnerAdapter(getActivity(), R.layout.owner_detail, listItem);
          if(!(searchParameter == null))
          {
              //ownerAdapter.clear();
          //  ownerAdapter.addAll(listItem);
              new OnwerAsyncTask().execute();
              //ownerAdapter.notifyDataSetChanged();
          }
      }
  
      @Override
      public void onListItemClick(ListView l, View v, int position, long id) {
          // TODO Auto-generated method stub
          //super.onListItemClick(l, v, position, id);
          int search = 0;
          Owner a = (Owner) getListView().getItemAtPosition(position);
          String name = a.getFirstName();
          String lName = a.getLastName();
          String Id = a.getCarId();
  
          FragmentManager mFragment = getChildFragmentManager();
          FragmentTransaction ft = mFragment.beginTransaction();
          CarDetail cDetail = new CarDetail();
          cDetail.SearchParameters(Integer.parseInt(Id));
          ft.replace(R.id.fCarDetail, cDetail);
          ft.addToBackStack(null);
          ft.commit();    
      }
  
  
      private class OnwerAsyncTask extends AsyncTask&lt;Void, Void, List&lt;Owner&gt;&gt; {
          @Override
          protected List&lt;Owner&gt; doInBackground(Void... params) {
              ArrayList&lt;Owner&gt; listItemLocal = new ArrayList&lt;Owner&gt;();
              try
              {
                  Owner items = new Owner();
                  items.setFirstName("John");
                  items.setLastName("Smith");
                  items.setCarId("1");
                  listItemLocal.add(items);
  
                  Owner item1 = new Owner();
                  item1.setFirstName("Samantha");
                  item1.setLastName("Right");
                  item1.setCarId("2");
                  listItemLocal.add(item1);
  
                  Owner item2 = new Owner();
                  item2.setFirstName("Regie");
                  item2.setLastName("Miller");
                  item2.setCarId("3");
                  listItemLocal.add(item2);
  
                  Owner item3 = new Owner();
                  item3.setFirstName("Mark");
                  item3.setLastName("Adam");
                  item3.setCarId("4");
                  listItemLocal.add(item3);
  
  
              } catch(Exception ex)
              {
                  ex.toString();
              }
              return listItemLocal;
          }
  
  
  
          @Override
          protected void onPreExecute() {
              listItem.clear();
              ownerAdapter.clear();
              super.onPreExecute();
          }
  
  
  
          @Override
          protected void onPostExecute(List&lt;Owner&gt; result) {
              /*OwnerDetail  fragment = (OwnerDetail) mActivity.getSupportFragmentManager().findFragmentById(R.id.fOwnerDetail);
              fragment.SetAdapter(result);*/
              listItem = (ArrayList&lt;Owner&gt;) result;
              super.onPostExecute(result);
              if(listItem.size() &gt; 0)
              {
                  ownerAdapter.clear();
                  ownerAdapter.addAll(listItem);
                  ownerAdapter.notifyDataSetChanged();
                  Log.i("Testing", "Added " + result.size() + "items to adapter.");
              }
          }
  
      }
  }
  </code></pre>