Code example for ListFragment

Methods: getActivity, onCreate, setRetainInstance

0
//  Overridden Methods 
//------------------------------------------ 
 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        mFetcher = UIUtils.getImageFetcher(getActivity());
        setRetainInstance(true);
    } 
 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
 
        setEmptyText(getString(R.string.no_news_items));
         
        mAdapter = new NewsItemsListAdapter(getActivity());
        setListAdapter(mAdapter);
        setListShown(false);