Code example for ResourceCursorAdapter

Methods: swapCursor

0
        return new CursorLoader(getActivity(), uri,
                NewsItemsQuery.PROJECTION, null, null, null);
    } 
 
    public void onLoadFinished(Loader<Cursor> listLoader, Cursor data) {
        mAdapter.swapCursor(data);
        setListShown(true);
    } 
 
    public void onLoaderReset(Loader<Cursor> listLoader) {
        mAdapter.swapCursor(null);
    } 
 
//------------------------------------------ 
//  Inner Classes 
//------------------------------------------ 
 
    public final class NewsItemsListAdapter extends ResourceCursorAdapter {
 
        public NewsItemsListAdapter(Context context) {
            super(context, R.layout.list_item_news_item, null, true);