Code example for AsyncTaskLoader

0
 
    private final StackoverflowCall serverCall;
    private CompletedTask completedTask;
 
    public StackoverflowLoader(Context context, URI uri) {
        super(context);
        serverCall = new StackoverflowCall(uri, this);
    } 
 
    @Override 
    protected void onStartLoading() { 
        super.onStartLoading(); 
        forceLoad();
    } 
 
    @Override 
    public CompletedTask loadInBackground() { 
        serverCall.execute();
        return completedTask;
    } 
Experience pair programming with AI  Get Codota for Java