title: ClassCastException: cannot be cast to android.app.Activity
body: <p>I have a list in a fragment and I want a new activity to start when I press something in that list. I have only tried with my first option but when I try it I get the error:</p>
  
  <pre><code>03-20 15:16:13.017: E/AndroidRuntime(941): Caused by: java.lang.ClassCastException: com.test.test.Algebra cannot be cast to android.app.Activity
  </code></pre>
  
  <p>Here's my fragment class:</p>
  
  <pre><code>public class FragmentTest extends SherlockListFragment {
  
  String formler[]= {
          "Algebra",
          "Aritmetik",
          "Differential- och integralkalkyl",
          "Funktioner",
          "Geometri",
          "Komplexa tal",
          "Statistik och sannolikhet",
          "Trigonometri"
  };
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      setListAdapter(new ArrayAdapter&lt;String&gt;(getActivity().getBaseContext(), android.R.layout.simple_list_item_1, formler));
  
      return super.onCreateView(inflater, container, savedInstanceState);
  }
  
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
      // TODO Auto-generated method stub
      super.onListItemClick(l, v, position, id);
      String choice = formler[position];
      try{
          @SuppressWarnings("rawtypes")
          Class choiceClass = Class.forName("com.test.test." + choice);
          Intent startIntent = new Intent(getActivity().getBaseContext(), choiceClass);
          startActivity(startIntent);
      }catch(ClassNotFoundException e){
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>What am I doing wrong?</p>