Alertdialog edittext gettext

Ravi8
Member

Alertdialog edittext gettext

Post By Ravi8 » 10 December 2016, 19:05

How to get text entered in editText in AlertDialog ? Please help Thanks in advance.
Manohar
Member

Re: Alertdialog edittext gettext

Post By Manohar » 11 December 2016, 05:48

editText.getText().toString() save it in a string and use that string inalert dialog
Vikash3
Member

Re: Alertdialog edittext gettext

Post By Vikash3 » 11 December 2016, 05:50

Have you initialized the dialog?
Sandeep9
Member

Re: Alertdialog edittext gettext

Post By Sandeep9 » 11 December 2016, 05:55

Use dialog box insted of alert dialog
Ravi8
Member

Re: Alertdialog edittext gettext

Post By Ravi8 » 11 December 2016, 05:55

This London text in editText of AlertDialog , I want it into string variable
Vikash3
Member

Re: Alertdialog edittext gettext

Post By Vikash3 » 11 December 2016, 05:56

Send screenshot of the dialog code
Nishu
Member

Re: Alertdialog edittext gettext

Post By Nishu » 11 December 2016, 05:57

Dialog dialog = new Dialog(context); dialog.setContentView(R.layout.your_xml); EditText edt = dialog.findViewById(R.id.your_edt_id); String edt_txt = edt.getText().toString(); dialog.show();
Pratik1
Member

Re: Alertdialog edittext gettext

Post By Pratik1 » 11 December 2016, 07:59

EditText = view.findbyviewid(R.ID.edtext) Edittext.gettext.toSteing();
Ankaiah
Member

Re: Alertdialog edittext gettext

Post By Ankaiah » 11 December 2016, 08:43

EditText edit = (EditText)alertDialog.findViewById(R.I'd.edittext); String txt = edit.get text().toString();
Ahsan6
Member

Re: Alertdialog edittext gettext

Post By Ahsan6 » 11 December 2016, 09:40

Use textwatcher
Ravi8
Member

Re: Alertdialog edittext gettext

Post By Ravi8 » 11 December 2016, 09:42

Thanks everyone for your time. My query is resolved. Thanks to @Nishu