本文转载至:http://blog.sina.com.cn/s/blog_86193b540100tulr.html
//得到自定义对话框
final View DialogView = a .inflate ( R.layout.loand, null);
//创建对话框
AlertDialog dlg = new AlertDialog.Builder(loand.this)
.setTitle("登录框")
.setView(DialogView)//设置自定义对话框的样式
setPositiveButton("登陆", //设置"确定"按钮
new DialogInterface.OnClickListener() //设置事件监听
{
public void onClick(DialogInterface dialog, int whichButton)
{
editText1 =(EditText) DialogView.findViewById(R.id.editText1);
editText2 =(EditText) DialogView.findViewById(R.id.editText2);
String id = editText1.getText().toString();
String password = editText2.getText().toString();
//输入完成后,点击“确定”开始登陆
c_log judge = new c_log();
boolean b_judge = judge.aa(id,password);
if(b_judge){
bar();
}else{
//加东西
DisplayToast("NO");
}
}
});
阅读(1618) | 评论(0) | 转发(0) |