Code example for AsyncTaskLoader

Methods: onReset, onStopLoading

0
        mLastLoad = System.currentTimeMillis();
    } 
     
    @Override 
    protected void onStopLoading() { 
    	super.onStopLoading(); 
    	 
        // This prevents the AsyncTask backing this loader from completing if it is currently running. 
        cancelLoad();
    } 
     
    /** 
     * Handles a request to cancel a load. 
     */ 
    @Override public void onCanceled(RESTResponse data) {
        super.onCanceled(data);
 
        // At this point we can release the resources associated with 'apps' if needed. 
        onReleaseResources(data);
    } 
     
    @Override 
    protected void onReset() { 
        super.onReset(); 
         
        // Stop the Loader if it is currently running. 
        onStopLoading(); 
         
        // Get rid of our cache if it exists.