Code example for ListFragment

Methods: getActivity, onResume, setListAdapter

0
        super.onAttach(activity);
    } 
 
    @Override 
    public void onResume() { 
        super.onResume(); 
        initializeCauseTypeList(); 
        OrganizationListAdapter adapter = new OrganizationListAdapter(
                ((Context) this.getActivity()), organizationItems);
        this.setListAdapter((ListAdapter) adapter);
    } 
 
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        context=(CheckinLibraryActivity)this.getActivity();
        initializeCauseTypeList(); 
        View fragmentView = inflater.inflate(
                R.layout.organization_fragment , null); 
        initializeOnClickHandlers(fragmentView);
        return fragmentView;
    }