The error is occurring because you haven't passed any params to the AsyncTask
when you call #execute()
. You declare that the AsyncTask
takes params of type String, but you don't pass in anything at all.
You'll need to call #execute
like this:
asyncTask.execute( (String) null );
or this:
asyncTask.execute( (String[]) null );
or change the generic type for the Params to Void if you want to call #execute
without any parameters.
Also, it's kind of pointless to declare the exact base async that you have demonstrated here. I assume you'll add something to it at some point, but I think you would be better served by having a base async that at least took care of the generic type parameters for you, i.e. -
public abstract class BaseHttpAsync extends AsyncTask<Uri, Void, HttpResult>
Declaring public abstract class AsyncTaskBase<Params, Progress, Result> extends AsyncTask<Params, Progress, Result> {}
effectively gains you no benefits.