I understand that this problem is somewhat trivial, but I'm interested in knowing the "right" answer.
I am trying to expand , but my task does not require any parameters.android.os.AsyncTask< Params, Progress, Result >
Given that I have to overload protected Result doInBackground(Params... params),
what is the βbestβ way to pass without parameters?
Currently, I use Objectas a type Paramsand run the task with:
new MyAsyncTask().execute( (Object)null );
This is fully functional, but I'm new to Java and don't know if this is a good way to accomplish what I'm trying to do.
Obviously, I cannot put Paramssomething like voidor in the field null, but if I use a wildcard, I'm not sure what to do with the arguments doInBackground(Params... params).
Any suggestions?
source
share