I have a standard entry popup dialog
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(title)
.setMessage(message)
.setPositiveButton(buttonPositif, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Send the positive button event back to the host activity
mListener.onDialogPositiveClick(EntryDialogFacade.this);
}
})
.setNegativeButton(buttonNegatif, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Send the negative button event back to the host activity
mListener.onDialogNegativeClick(EntryDialogFacade.this);
}
});
editText = new EditText(activity);
editText.setLines(1);
editText.setImeOptions(EditorInfo.IME_ACTION_DONE);
builder.setView(editText);
Dialog dialog = builder.create();
dialog.show();
I am trying to show the Done button on the entry field keyboard (see code snippet), however, this is not working this way.
Would have anyone experienced the same thing?
Cheers.
You’ll need to use
setSingleLine(true)rather thansetLines(1)and then you need anEditorActionListenerto catch theDonekey.