title: SherlockfragmentActivity and sherlockListFragment
body: <p>I'm trying to make a drobdown navigation menu so i can move between my pages using SherlockFragmentActivity and SerlockListFragment 
  but every time i'm starting my app it's give this following error:
  </p>
  <p>
    <strong>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.download.manager/com.download.manager.Main}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is android.R.id.list</strong>
  </p>
  <p>
  this is SherlockFragmentActivity class
  </p>
  <pre><code>public class Main extends SherlockFragmentActivity implements OnNavigationListener{
  
  private static final String KEY_MODELS=&quot;models&quot;;
  private static final String KEY_POSITION=&quot;position&quot;;
  private static final String[] labels= { &quot;All&quot;, &quot;Downloads&quot;,&quot;Completed&quot;,&quot;Later&quot; };
  private CharSequence[] models=new CharSequence[4];
  private DownloadList frag=null;
  private int lastPosition=-1;  
  
  ActionBar act;
  ViewPager myviewpager;
  int mSelectedPageIndex=1;
  DownloadService downloadservice;
  Intent serviceIntent ;
  
  
  @Override
  public void onCreate(Bundle state) {
      super.onCreate(state);
      
      frag=(DownloadList)getSupportFragmentManager().findFragmentById(android.R.id.content);
      if (frag==null) {
          frag=new DownloadList();
          getSupportFragmentManager().beginTransaction().add(android.R.id.content, frag).commit();
        }
  
      if (state != null) {
          models=state.getCharSequenceArray(KEY_MODELS);
        }
      
      if (downloadservice==null)
          downloadservice= new DownloadService();
      ArrayAdapter&lt;String&gt; nav=null;
      act=getSupportActionBar();
     
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
      {
        nav= new ArrayAdapter&lt;String&gt;( act.getThemedContext(),android.R.layout.simple_spinner_item,labels);
      }
      else 
      {
        nav=new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_spinner_item,labels);
      }
      
      nav.setDropDownViewResource(android.R.layout.simple_list_item_1);
      act.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
      act.setDisplayShowTitleEnabled(false);
      act.setHomeButtonEnabled(false);
      
      act.setListNavigationCallbacks(nav, this);
      if (state != null) {
          act.setSelectedNavigationItem(state.getInt(KEY_POSITION));
        }
     
      serviceIntent= new Intent(Main.this,downloadservice.getClass());
      if (startService(serviceIntent)==null)
          startService(serviceIntent);
      
      act.setTitle(&quot;&quot;);
     
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      MenuInflater infalter = getSupportMenuInflater();
      infalter.inflate(R.menu.mymenu, menu);
      
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      if (item.getItemId()==R.id.sub1)
      {
          AlertDialog.Builder alert = new AlertDialog.Builder(this);
          alert.setTitle(&quot;Downlaod New File&quot;);
          alert.setMessage(&quot;Enter URL&quot;);
          final EditText input = new EditText(this);
          alert.setView(input);
  input.setText(&quot;http://205.196.123.184/ddpha7c5b8lg/616c36j0d1xbztf   /Lecture+ppt+Ch2.ppt&quot;);
          alert.setPositiveButton(&quot;Ok&quot;, new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int whichButton) {
                  String value = input.getText().toString();
                  Log.d(&quot;value&quot;,value);
              }
          });
  
          alert.setNegativeButton(&quot;Cancel&quot;, new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int whichButton) {
              }
          });
  
          alert.show();
      }   
          
      return super.onOptionsItemSelected(item);
  }
  
  
  @Override
  protected void onSaveInstanceState(Bundle outState) {
      super.onSaveInstanceState(outState);
      
  }
  
  @Override
  public boolean onNavigationItemSelected(int itemPosition, long itemId) {
      lastPosition=itemPosition;
      
      
      
      return false;
  }
  </code></pre>
  <p>
  this is SherlockListFragment class
  </p>
  <pre><code>public  class DownloadList extends SherlockListFragment {
  int index=0;
  Button downloadButton;
  Button pauseButton;
  Button resumeButton;
  TextView textLink;
  TextView progressbar;
  DownloadService downloadservice= new DownloadService();
  MyAdapter listadapter;
  Intent serviceIntent ;
  String state;
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      getActivity().setContentView(R.layout.downloadlist);
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup          
   container,BundlesavedInstanceState) {
      View rootView = inflater.inflate(R.layout.downloadlist, container, false);
      
      
      
      return rootView;
  }
  int getIndex()
  {
      return index;
  }
  public class MyAdapter extends ArrayAdapter&lt;NewDownload&gt;
  {
       private final List&lt;NewDownload&gt; list;
        private final Activity context;
        Thread t;
        
      public MyAdapter(Context context,List&lt;NewDownload&gt; list) {
          super(context, R.layout.list_item,  list);
          this.context = (Activity) context;
          this.list = list;
      }
          @Override
          public View getView(int position, View convertView, ViewGroup parent) {
              LayoutInflater inflater = (LayoutInflater) getActivity().
                                            getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              View row = inflater.inflate(R.layout.list_item, null);
  
              pauseButton = (Button) row.findViewById(R.id.btn1);
              resumeButton = (Button) row.findViewById(R.id.btn2);
              textLink = (TextView) row.findViewById(R.id.tv1);
              progressbar = (TextView) row.findViewById(R.id.progressBar1);
              
                    textLink.setText(downloadservice.
                                        downloads.get(position).getName());
                 progressbar.setBottom(downloadservice.
                                       downloads.get(position).getDownloadedSize());
              progressbar.setTop(downloadservice.
                                        downloads.get(position).getTotalSize());
              
              final int p = position;
              final NewDownload r = list.get(p);
              if (r.state==&quot;downloading&quot;)
                  {
                      progressbar.setText(&quot;DownLoading...&quot;);
                      pauseButton.setEnabled(true);
                      resumeButton.setEnabled(false);
                  }
              else if (r.state==&quot;pause&quot;)
                  {
                  pauseButton.setEnabled(false);
                  resumeButton.setEnabled(true);
                  progressbar.setText(r.state);
                  }
              pauseButton.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                  downloadservice.pause(p);
                  setListAdapter(listadapter );
  
                  }
              });
                          
              resumeButton.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
              if (getActivity().startService(serviceIntent)==null)
                          
                        getActivity().startService(serviceIntent);
                  downloadservice.resume(p);
                  setListAdapter(listadapter );
                  }
              });
              
              return row;
          }
  }
  </code></pre>
  <p> this is downloadlist.xml</p>
  <pre><code>    &lt;ListView
      android:id=&quot;@+id/list&quot; xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;wrap_content&quot; &gt;
  &lt;/ListView&gt;
  </code></pre>
  <p> this is list_item.XML </p>
  <pre><code>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  android:layout_width=&quot;match_parent&quot;
  android:layout_height=&quot;match_parent&quot;
  android:orientation=&quot;vertical&quot; &gt;
  
  &lt;TextView
      android:id=&quot;@+id/tv1&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:layout_gravity=&quot;center_horizontal&quot;
      android:text=&quot;File Name&quot; /&gt;
  
  &lt;TextView
      android:id=&quot;@+id/progressBar1&quot;
      
      android:layout_width=&quot;306dp&quot;
      android:layout_height=&quot;wrap_content&quot;
       /&gt;
  
  &lt;LinearLayout
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;wrap_content&quot; &gt;
  
  
  
  
  
      &lt;Button
          android:id=&quot;@+id/btn1&quot;
          style=&quot;?android:attr/buttonStyleSmall&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;34dp&quot;
          android:layout_gravity=&quot;center_horizontal&quot;
          android:text=&quot;Pause&quot; /&gt;
  
  
  
  
      &lt;Button
          android:id=&quot;@+id/btn2&quot;
          style=&quot;?android:attr/buttonStyleSmall&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;34dp&quot;
          android:layout_gravity=&quot;right&quot;
          android:text=&quot;Resume&quot; /&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>So any one can tell me where is my mistake ?</p>