编译器错误是“ The method execute(ArrayList<String>...) in the type AsyncTask<ArrayList<String>,Void,ArrayList<String>> is not applicable for the arguments (String)
”
为什么它不接受新参数?谁能看到我做错了什么?
ArrayList<String> passing = new ArrayList<String>();
passing.add(logicalUrl);
passing.add("filename.pdf");
new myTask().execute(logicalUrl);
return true;
}
public class myTask extends AsyncTask<ArrayList<String>, Void, ArrayList<String>> {
ProgressDialog dialog;
@Override
protected void onPreExecute() {
dialog = new ProgressDialog(ModuleContents.this);
dialog.setTitle("Downloading...");
dialog.setMessage("Please wait...");
dialog.setIndeterminate(true);
dialog.show();
}
protected ArrayList<String> doInBackground(ArrayList<String>... passing) {
ArrayList<String> passed = passing[0];
String physicalUrl = parsePhysicalUrl(passed.get(0));
String filename = passed.get(1);
try {
globals.saveFile(physicalUrl, filename);
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return passed;
}