有沒有什麼方法能把文件傳遞給AsyncTask,比如:
public class UploadImagesTask extends AsyncTask<String, String, File> {
@Override
protected File doInBackground(String... params) {
還有能不能這樣獲取文件:
params[2]
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);