Code example for CursorLoader

Methods: setUpdateThrottle

0
            MainTable._ID,
            MainTable.COLUMN_NAME_DATA,
        }; 
 
        public Loader<Cursor> onCreateLoader(int id, Bundle args) {
            CursorLoader cl = new CursorLoader(getActivity(), MainTable.CONTENT_URI,
                    PROJECTION, null, null, null);
            cl.setUpdateThrottle(2000); // update at most every 2 seconds.
            return cl;
        } 
 
        public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
            mAdapter.swapCursor(data);
        } 
 
        public void onLoaderReset(Loader<Cursor> loader) {
            mAdapter.swapCursor(null);
        } 
    } 
}