Code example for AsyncTaskLoader

     * Creates a ModelLoader for models of the specified type. 
    public ModelLoader(Context context, Class<T> modelType) {
        mObserver = new ForceLoadContentObserver();
        mModelType = modelType;
    ///// AsyncTaskLoader 
    public ModelCursor<T> loadInBackground() { 
        ModelManager manager = new ModelManager(getContext());
        ModelCursor<T> cursor = manager.query(
                mModelType, mProjection, mSelection, mSelectionArgs, mSortOrder);
        if (cursor != null) {
            // Ensure the cursor window is filled 
Connect your IDE to all the code out there  Get Codota for Java