我有一个需要调用另一个的静态类,第一个是静态的,并阻止我调用第二个并出现以下错误:
No enclosing instance of type Studies is accessible. Must qualify the allocation with an enclosing instance of type Studies (e.g. x.new A() where x is
an instance of Studies).
异步任务类
class DownloadFileAsync extends AsyncTask<String, String, String> {
@Override
protected void onPreExecute() {}
@Override
protected String doInBackground(String... aurl) {}
}
静态类
public static void startDownload(int id) {
ERROR LINE--> new DownloadFileAsync().execute("SOME URL");
}
谢谢!