Code example for ListFragment

Methods: getActivity, onActivityCreated, setEmptyText, setHasOptionsMenu, setListAdapter

0
    } 
 
 
     
    @Override public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(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());
        mAdapter.setNotifyOnChange(true);
        setListAdapter(mAdapter);
 
 
         
        //Just use the manually set initial bibletext if set else find the bibletextview 
        if (initialBibleText != null) {
        	updateList(initialBibleText);
        } 
         
        updateList(Utils.loadBibleText(getActivity().getSharedPreferences("APP SETTINGS", Context.MODE_PRIVATE)));
         
        // Set to true so option menu gets called future support for action bar ICS 
        setHasOptionsMenu(true);
    } 
 
  
    @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