0
我的异步方法是给编译器error.This是我的代码:的Android异步任务编译器错误
private void registerInBackground() {
new AsyncTask() {
@Override
protected String doInBackground(Void... params) {
}
@Override
protected void onPostExecute(String msg) {
}
}.execute(null, null, null);
}
对于线2我收到此错误:
Multiple markers at this line
- The type new AsyncTask(){} must implement the inherited abstract method AsyncTask.doInBackground(Object...)
- Type safety: The method execute(Object...) belongs to the raw type AsyncTask. References to generic type AsyncTask<Params,Progress,Result> should be
parameterized
- AsyncTask is a raw type. References to generic type AsyncTask<Params,Progress,Result> should be parameterized
对于4号线我得到此错误:
The method doInBackground(Void...) of type new AsyncTask(){} must override or implement a supertype method
我该如何解决它们?我的代码有什么问题?