Is it possible to pass a File to AsyncTask? Like this?
public class UploadImagesTask extends AsyncTask<String, String, File> {
@Override
protected File doInBackground(String... params) {
and would I access that file by doing this?
params[2]
Not like that, no.
If you want to pass in a
Stringand aFile, you’ll need to do something like this, and trust yourself not to screw up the arguments.Since all your arguments extend
Object, when you call the thing, it’ll look like this:Alternately, you can pass whatever you want in through constructor arguments.