Code example for AsyncTaskLoader

Methods: onStartLoading

0
        this.barcode = barcode;
    } 
 
    @Override 
    protected void onStartLoading() { 
        super.onStartLoading(); 
        forceLoad();
    } 
 
    @Override 
    public AsyncResult<Void> loadInBackground() {
        try { 
            client.submitBarcode(mbid, barcode);
            return new AsyncResult<Void>(LoaderStatus.SUCCESS);
        } catch (IOException e) {
            return new AsyncResult<Void>(LoaderStatus.EXCEPTION, e);
        } 
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java