input edittext in android dialog

Solutions on MaxInterview for input edittext in android dialog by the best coders in the world

showing results for - "input edittext in android dialog"
Regina
24 Jun 2018
1final View view = layoutInflater.inflate(R.layout.xml_file_created_above, null);
2AlertDialog alertDialog = new AlertDialog.Builder(ct).create();
3alertDialog.setTitle("Your Title Here");
4alertDialog.setIcon("Icon id here");
5alertDialog.setCancelable(false);
6Constant.alertDialog.setMessage("Your Message Here");
7
8
9final EditText etComments = (EditText) view.findViewById(R.id.etComments);
10
11alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new OnClickListener() {
12    @Override
13    public void onClick(DialogInterface dialog, int which) {
14
15    }
16});
17
18
19alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, "Cancel", new OnClickListener() {
20    @Override
21    public void onClick(DialogInterface dialog, int which) {
22        alertDialog.dismiss()
23    }
24});
25
26
27alertDialog.setView(view);
28alertDialog.show();