Code example for ListFragment

Methods: getLoaderManager, onActivityCreated, setListAdapter, setListShown

0
        return v;
    } 
 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        setListAdapter(controller.getAdapter());
        setListShown(false);
        getLoaderManager().initLoader(0, null, this);
    } 
 
    @Override 
    public Loader<Cursor> onCreateLoader(int id, Bundle args) {
        return controller.createLoader();
    } 
 
    @Override 
    public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
        controller.swapCursor(cursor);
        setEmptyText(getEmptyText(cursor));
        setListShown(true);