Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding EditText to the dialog box
    text
    copied!<p>I have a Dialog window like the one shown in picture, and I have requirement of adding one EditText(to take quantity) next to every item, any possible ways to achieve this...?</p> <p><img src="https://i.stack.imgur.com/8OXZd.png" alt="want to add EditText next to every item"></p> <p>I have tried creating seperate view and setting it to AlertDialog, but getting single edittext at bottom..</p> <p>Is there any possible ways that I can add EditText next to every item in the checklist, bec items here are populating from one one Array Items[], with</p> <pre><code> DialogInterface.OnMultiChoiceClickListener itemsDialogListener = new DialogInterface.OnMultiChoiceClickListener() { @Override public void onClick(DialogInterface dialog, int which, boolean isChecked) { if(isChecked) selectedItems.add(Items[which]); else selectedItems.remove(Items[which]); StringBuilder stringBuilder = new StringBuilder(); for(CharSequence item : selectedItems) stringBuilder.append(item + ","); selectItems.setText(stringBuilder.toString()); } }; AlertDialog.Builder builder = new AlertDialog.Builder(this); LayoutInflater li=LayoutInflater.from(this); View v1=li.inflate(R.layout.itementry, null);//itementry view has one EditText builder.setTitle("Select Items"); builder.setMultiChoiceItems(colours, checkedItems, itemsDialogListener); builder.setView(v1); //By setting this line only one EditText is visible at the bottom of alert dialog. AlertDialog dialog = builder.create(); dialog.show(); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload