有没有什么方法能把文件传递给AsyncTask,比如:
public class UploadImagesTask extends AsyncTask<String, String, File> {
@Override
protected File doInBackground(String... params) {
还有能不能这样获取文件:
params[2]
有没有什么方法能把文件传递给AsyncTask,比如:
public class UploadImagesTask extends AsyncTask<String, String, File> {
@Override
protected File doInBackground(String... params) {
还有能不能这样获取文件:
params[2]
收起
当前问题酬金
¥ 0 (可追加 ¥500)
支付方式
扫码支付
public class DoThing extends AsyncTask<Object, String, File> {
@Override
protected File doInBackground(Object... params) {
String stringy = (String) params[0];
File file = (File) params[1];
return file;
}
}
由于你的参数继承于Object
,调用的时候:
String aString = stringGettingMethod();
File aFile = fileGettingMethod();
new DoThing().execute(aString, aFile);
报告相同问题?