LayoutInflater inflater = LayoutInflater.from(main.this);//当前类
// 得到自定义对话框
final View DialogView = inflater.inflate(R.layout.main, null);
// 创建对话框
AlertDialog alertDialog = new AlertDialog.Builder(main.this)
.setTitle("选择日期")
.setView(DialogView)
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
final ProgressDialog m_Dialog = ProgressDialog.show(
main.this, "请等待...", "系统正在登录...", true);
new Thread() {
public void run() {
try {
sleep(3000);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
} finally {
// 登录结束,取消m_Dialog对话框
m_Dialog.dismiss();
}
}
}.start();
}
}).setNegativeButton("取消",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// 点击取消后推出Activity01
main.this.finish();
}
}).create();// 创建
alertDialog.show();
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。