Code example for CursorAdapter

Methods: swapCursor

0
        return new CursorLoader(getActivity(), Episodes.buildEpisodeWithShowUri(String 
                .valueOf(getEpisodeId())), DetailsQuery.PROJECTION, null, null, null); 
    } 
 
    public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
        mAdapter.swapCursor(data); 
    } 
 
    public void onLoaderReset(Loader<Cursor> loader) {
        mAdapter.swapCursor(null); 
    } 
 
    @Override 
    public void onFlagCompleted(FlagAction action, int showId, int itemId, boolean isSuccessful) {
        if (isSuccessful && isAdded()) { 
            getLoaderManager().restartLoader(EPISODE_LOADER, null, this); 
        } 
    } 
 
    private void fireTrackerEvent(String label) {
        EasyTracker.getTracker().sendEvent(TAG, "Action Item", label, (long) 0);