朋友
I m quite new so sorry for the basic question but after hours of searching I gave up. How do i add a second EditText to my AlertDialog? It shows just one Edittext with the two Buttons. The second EditText is not Displayed at all.
我的法典
final AlertDialog.Builder alert = new AlertDialog.Builder(ctx);
final EditText inputstreet = new EditText(ctx);
final EditText inputstreetnumber = new EditText(ctx);
alert.setView(inputstreet);
alert.setView(inputstreetnumber);
alert.setTitle(getResources().getString(R.string.t_MainAlertEnterAdressTitle));
// alert.setIcon(R.drawable.huji2); // Icon disabled for now
alert.setMessage(getResources().getString(R.string.t_MainAlertEnterAdressMessage));
alert.setPositiveButton(getResources().getString(R.string.t_MainAlertEnterAdressButtonOk),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int whichButton) {
finish();
}
});
alert.setNegativeButton(getResources().getString(R.string.t_MainAlertEnterAdressButtonBack),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int whichButton) {
dialog.cancel();
}
});
alert.show();
我删除了不重要的一切。 祝!