application crashing when using getview in listfragment
<p>I'm learning how to use ListFragment and the application is crashing when it runs the following code:</p>

<pre><code>public class profileListFragment extends ListFragment {

String[] countries = new String[] {"USA", "China"};

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(inflater.getContext(),
            android.R.layout.simple_list_item_1,countries);
    setListAdapter(adapter);
    View retView = super.onCreateView(inflater, container,  savedInstanceState);

    return retView;//super.onCreateView(inflater, container,  savedInstanceState);
}

public void onListItemClick(ListView I, View v, int position, long id){
    I.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    I.setSelector(android.R.color.holo_blue_light);
}
}
</code></pre>

<p>I know it is because of the getListView() statement since when I remove it it doesn't crash...</p>

<p>Any help much appreciated</p>

<pre><code>I/ActivityManager(352): START {cmp=myapp.app/.loadProfile u=0} from pid 24295

E/AndroidRuntime(24295): java.lang.RuntimeException: Unable to start activity ComponentInfo{myapp.app/myapp.app.loadProfile}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment

E/AndroidRuntime(24295): at myapp.app.loadProfile.onCreate(loadProfile.java:12)

E/AndroidRuntime(24295): at myapp.app.profileListFragment.onCreateView(profileListFragment.java:19)

11-10 22:15:01.002: W/ActivityManager(352):   Force finishing activity myapp.app/.loadProfile
</code></pre>
