Code example for ListFragment

Methods: setEmptyTextsetListAdapter, getActivity, onActivityCreated, setHasOptionsMenu

    @Override public void onActivityCreated(Bundle savedInstanceState) {
        // Give some text to display if there is no data.  In a real 
        // application this would come from a resource. 
        setEmptyText("Audio only available for KJV and ESV");
//        //Only have one choice 
//        getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); 
        // Create an empty adapter we will use to display the loaded data. 
        mAdapter = new AudioBibleAdapter(getActivity());
        //Just use the manually set initial bibletext if set else find the bibletextview 
        if (initialBibleText != null) {
        updateList(Utils.loadBibleText(getActivity().getSharedPreferences("APP SETTINGS", Context.MODE_PRIVATE)));
        // Set to true so option menu gets called future support for action bar ICS 
    @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        //Doesn't get called for one reason or another will just do it in the parent activity 
Contextual code suggestions in your IDE  Get Codota for Java