Могу ли я просто не закрывать свой AlertDialog после нажатия PositiveButton?
Я хотел бы оставить диалоговое окно, чтобы показать что-то обновленное в моем списке ArrayAdapter ListWords. >
Это мой код.
AlertDialog.Builder sayWindows = new AlertDialog.Builder(MapActivity.this);
final EditText saySomething = new EditText(MapActivity.this);
sayWindows.setPositiveButton("ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
say = userName + " Says: "+saySomething.getText();
showPosition.setText(say);
}
});
sayWindows.setNegativeButton("cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
sayWindows.setAdapter(listWords, null);
sayWindows.setView(saySomething);
sayWindows.create().show();
Подробнее здесь: https://stackoverflow.com/questions/260 ... tivebutton
Android Не закрывайте AlertDialog после нажатия PositiveButton ⇐ Android
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Открывайте и закрывайте вкладки Firefox и переключайте фокус с помощью селена в Python 3.
Anonymous » » в форуме Python - 0 Ответы
- 29 Просмотры
-
Последнее сообщение Anonymous
-