方法不适用参数

老师,我要做的是点击一个按钮出现进度提示框5秒后消失 出现错误:The method show(Context, CharSequence, CharSequence) in the type ProgressDialog is not applicable for the arguments (new View.OnClickListener(){}, String, String)

我的代码是:

bt1 = (Button)findViewById(R.id.button2);

        et1 = (EditText) findViewById(R.id.editText1);

        

        bt1.setOnClickListener(new OnClickListener() {

@Override

public void onClick(View v) {

final ProgressDialog dialog = ProgressDialog.show(this, "Doing something","P;ease wait...");

new Thread(new Runnable() {

@Override

public void run() {

try{

Thread.sleep(5000);

dialog.dismiss();

}catch (InterruptedException e){

e.printStackTrace();

}

}

}).start();

}

});

麻烦老师帮我看一下吧

qq_叁火Bao_03130340
浏览 1131回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Android