is there a way to handle long user inputs in alert dialogs? I have a small alert dialog that requires a few inputs and whenever the string input is too long, the other inputs and textviews get all squished up. Is there a way to put the string input on a different line or a way to wrap the other textfields? Im creating the alertdialog straight from code rather than XML.
LinearLayout layout = new LinearLayout(this);
EditText weight = new EditText(this);
EditText mark = new EditText(this);
TextView marktext = new TextView(this);
marktext.setText("Mark");
TextView weighttext = new TextView(this);
weighttext.setText("Weight");
mark.setInputType(InputType.TYPE_CLASS_NUMBER);
weight.setInputType(InputType.TYPE_CLASS_NUMBER);
//Assignment name input
EditText workType = new EditText(this);
workType.setInputType(InputType.TYPE_CLASS_TEXT);
TextView workTypeText = new TextView(this);
workTypeText.setText("Name of the work: ");
weight.setId(99);
mark.setId(100);
workType.setId(9999);
/*Spinner addworkspinner = new Spinner(this);
ArrayAdapter<String> addworkadapter = new ArrayAdapter<String>(
this, android.R.layout.simple_spinner_item, ClassManager.possiblework);
addworkspinner.setAdapter(addworkadapter); */
layout.addView(workTypeText);
layout.addView(workType);
layout.addView(marktext);
layout.addView(mark);
layout.addView(weighttext);
layout.addView(weight);
AlertDialog.Builder addwork = new AlertDialog.Builder(this);
addwork.setTitle("Add a piece of work");
addwork.setView(layout);