I am wondering if there is a way to handle the user pressing Enter while typing in an EditText
, something like the onSubmit HTML event.
Also wondering if there is a way to manipulate the virtual keyboard in such a way that the "Done" button is labeled something else (for example "Go") and performs a certain action when clicked (again, like onSubmit).
Best Answer
Yes.
Also yes.
You will want to look at the
android:imeActionId
andandroid:imeOptions
attributes, plus thesetOnEditorActionListener()
method, all onTextView
.For changing the text of the "Done" button to a custom string, use: