Code example for AsyncTaskLoader

Methods: onStartLoading

0
        serverCall = new StackoverflowCall(uri, this);
    } 
 
    @Override 
    protected void onStartLoading() { 
        super.onStartLoading(); 
        forceLoad();
    } 
 
    @Override 
    public CompletedTask loadInBackground() { 
        serverCall.execute();
        return completedTask;
    } 
 
    @Override 
    public void onStackoverflowCallSuccess(String json) {
        completedTask = new CompletedTask(CompletedTask.Result.SUCCESS, json);
    }