class btn_registOnclick implements OnClickListener{
ProgressDialog r_Dialog;
LayoutInflater regist_Inflater = LayoutInflater.from(Fx.this);
final View registView = regist_Inflater.inflate(R.layout.regist, null);
AlertDialog registDlg = new AlertDialog.Builder(Fx.this).
setTitle("请登录").
setView(registView).
setPositiveButton("确定", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton1) {
// TODO Auto-generated method stub
r_Dialog = ProgressDialog.show(Fx.this, "请等待...", "正在为您登录...",true);
new Thread(){
public void run(){
try{
sleep(3000);
}
catch(Exception e){
e.printStackTrace();
}
finally{
LayoutInflater regist_Inflater = LayoutInflater.from(Fx.this);
View fxView = regist_Inflater.inflate(R.layout.activity_fx, null);
fxView.findViewById(R.id.btn_login).setBackgroundColor(Color.BLACK);//其中R.id.btn_login是初始屏幕中的一个按钮未报错,但是背景没有变黑
r_Dialog.dismiss();
}
}
}.start();
}
}).
setNegativeButton("取消",null).
create();
public void onClick(View v){
registDlg.show();//显示登录对话框
}
}
对话框 异常 Java android
------解决方案--------------------
LayoutInflater regist_Inflater = LayoutInflater.from(Fx.this); View fxView = regist_Inflater.inflate(R.layout.activity_fx, null); fxView.findViewById(R.id.btn_login).setBackgroundColor(Color.BLACK);//其中R.id.btn
这个view没看到你用啊.
------解决方案--------------------