Code example for AsyncTaskLoader

0
            oldCursor.close();
        } 
    } 
 
    public OrmliteCursorLoader(Context context, AndroidBaseDaoImpl<T,?> dao, PreparedQuery<T> query) {
        super(context);
        mObserver = new ForceLoadContentObserver();
        mDao = dao;
        mQuery = query;
    } 
 
    @Override 
    protected void onStartLoading() { 
        if (mCursor != null) {
            deliverResult(mCursor);
        } 
        if (takeContentChanged() || mCursor == null) {
            forceLoad();
        } 
    }