Я хочу добавить два текстовых поля редактирования в диалоговом окне предупреждения. Так же просто, как и в решении, я пока не смог собрать рабочий. Я не могу установить два (редактировать текст) одновременно.
Прошу прокомментировать, если вы хотите увидеть какой-либо дополнительный код.
alertDialog.setTitle("Values");
final EditText quantity = new EditText(SecondScan.this);
final EditText lot = new EditText(SecondScan.this);
quantity.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
lot.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
Project=arr[0].toString();
Item=arr[1].toString();
alertDialog.setMessage( "Employee No. : " + (Login.user).trim()+
"\nWarehouse : " + (FirstScan.Warehouse).trim()+
"\nLocation : " + (FirstScan.Location).trim()+
"\nProject : " + Project.trim() +
"\nItem : " + Item.trim() +
"\nLot : " + Lot.trim()+
"\n\nQuantity :" );
alertDialog.setView(quantity);
alertDialog.setView(lot);
// the bit of code that doesn't seem to be working.
alertDialog.setCancelable(false);
alertDialog.setPositiveButton("Update", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//ACTION
}
});
AlertDialog alert = alertDialog.create();
alert.show();
Я хочу, чтобы первый текст редактирования появлялся после лота, а второй после количество, тогда как только один из них, похоже, работает, когда я пытаюсь нажать на оба взгляды.
UPDATE. Как оказалось, на самом деле нет метода добавления более одного представления в диалоговое окно предупреждения без необходимости создания макета для него.