final EditText inputServer = new EditText(SettingActivity.this);
AlertDialog.Builder builder = new AlertDialog.Builder(SettingActivity.this);
builder.setTitle("输入密码").setIcon(android.R.drawable.ic_dialog_info).setView(inputServer)
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
String text = inputServer.getText().toString(); });
builder.show();
}
});
android 弹出输入框,获取输入框值,带确定 取消 按钮