Code example for AsyncTaskLoader

Methods: deliverResult

        Cursor oldCursor = mCursor;
        mCursor = cursor;
        if(isStarted()) super.deliverResult(cursor);
        if(oldCursor != null && oldCursor != cursor && !oldCursor.isClosed()) oldCursor.close();
    /*Starts an asynchronous load of the contacts list data. When the result is ready the callbacks 
    will be called on the UI thread. If a previous load has been completed and is still valid 
	the result may be passed to the callbacks immediately. 
	Must be called from the UI thread*/ 
    protected void onStartLoading() { 
        if(mCursor != null) deliverResult(mCursor);