方法doInBackground不会从超类重写

时间:2019-03-12 15:34:53

标签: android android-asynctask

我正在尝试使用AsyncTask,但是我的doInBackground和onPostExecute方法都给了我同样的错误,说Method does not override method from its superclass。我的代码是:

public class SigninActivity extends AsyncTask{

    private TextView status, result;
    private Context context;
    private int flag = 0;

    public SigninActivity(Context context, TextView status, TextView result, int flag) {
        this.context = context;
        this.statusField = status;
        this.roleField = result;
        this.flag = flag;
    }

    protected void onPreExecute() {
    }

    @Override
    protected String doInBackground(String... arg0) {
        //Code
    }

    @Override
    protected void onPostExecute(String result) {
        //Code
    }

0 个答案:

没有答案