LinearLayout layout = (LinearLayout)
mInflater.inflate(R.layout.bind_weibo_dialog, null);
myDialog = new AlertDialog.Builder(this).create();
myDialog.setView(layout, 0, 0, 0, 0);
myDialog.setOnKeyListener(keyListener);
name_EditText = (EditText)
layout.findViewById(R.id.bind_weibo_dialog_name);
pass_EditText = (EditText)
layout.findViewById(R.id.bind_weibo_dialog_password);
layout.findViewById(R.id.bind_weibo_dialog_btn_ok).setOnClickListener(new
Button.OnClickListener()
{
public void onClick(View view)
{
checkInputInfoToBindWeiBo();
}
});
myDialog.show();
myDialog = new Dialog(this, R.style.TANCStyle);
myDialog.setContentView(R.layout.bind_weibo_dialog);
myDialog.setOnKeyListener(keyListener);
name_EditText = (EditText) myDialog.findViewById(R.id.bind_weibo_dialog_name);
pass_EditText = (EditText) myDialog.findViewById(R.id.bind_weibo_dialog_password);
myDialog.findViewById(R.id.bind_weibo_dialog_btn_ok).setOnClickListener(new Button.OnClickListener()
{
public void onClick(View view)
{
checkInputInfoToBindWeiBo();
}
});
myDialog.show();
myDialog = new AlertDialog.Builder(this).create();
myDialog.setOnKeyListener(keyListener);
myDialog.show();
// 注意此处要放在show之后 否则会报异常
myDialog.setContentView(R.layout.bind_weibo_dialog);
name_EditText = (EditText)
myDialog.findViewById(R.id.bind_weibo_dialog_name);
pass_EditText = (EditText)
myDialog.findViewById(R.id.bind_weibo_dialog_password);
myDialog.findViewById(R.id.bind_weibo_dialog_btn_ok).setOnClickListener(new
OnClickListener()
{
@Override
public void onClick(View v)
{
checkInputInfoToBindWeiBo();
}
});