title: ListFragment and ListView
body: <p>I cant extend my class to <code>ListFragment</code>.It gives me ClassCastException error.  The code was working while extending <code>ListActivity</code>.And it also works while extending Fagment (when lists not used). But ListFragment gives errors, and I couldnt find solution.
  Is there any way to solve it? Maybe an inner class that extends ListFragment/ListActivity may solve problem but I couldnt achieve it .</p>
  
  <p>I want to set adapters:</p>
  
  <pre><code>setListAdapter(Adapter&lt;String&gt;(this, R.layout.row));
  m_List = (ArrayAdapter&lt;String&gt;)getListAdapter();
  </code></pre>
  
  <p>xml</p>
  
  <pre><code>&lt;ListView
          android:id="@+id/android:list"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"/&gt;
      &lt;TextView
          android:id="@+id/android:empty"
          android:text=""
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:gravity="center_horizontal"/&gt;
  </code></pre>
  
  <p>activity</p>
  
  <pre><code>public class MyActivity extends Fragment  {
  
      public class MyListFragment extends ListActivity {        
                 @Override
              public void onCreate(Bundle savedInstanceState) {
                     super.onCreate(savedInstanceState);    
                  setContentView(R.layout.stopwatch);
      setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.row));               
               m_List = (ArrayAdapter&lt;String&gt;)getListAdapter();
  
            }
  
       @Override
          public View onCreateView(LayoutInflater inflater, ViewGroup container,
                  Bundle savedInstanceState) {
              v = inflater.inflate(R.layout.stopwatch, container, false);
      MyListFragment ma = new MyListFragment();  // ???
      }
  
      }
  </code></pre>