Code example for AsyncTaskLoader

0
 
    /** 
     * Creates a ModelLoader for models of the specified type. 
     */ 
    public ModelLoader(Context context, Class<T> modelType) {
        super(context);
        mObserver = new ForceLoadContentObserver();
        mModelType = modelType;
    } 
 
    ///// AsyncTaskLoader 
 
    @Override 
    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 
            cursor.getCount();
Contextual code suggestions in your IDE  Get Codota for Java