I have an Edit Text that is defined as follows.
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="text"
android:hint="@string/field_text"
android:id="@+id/field"
/>
I want to set a custom command so that when somebody clicks on the Done/Go button on the onscreen keyboard a button is clicked or just run the methods that are run by the button. I think this has something to do with ime options but I havent been able to figure out how they work. Thanks in advance for any help!
You want a combination of android:imeOptions and setOnEditorActionListener
Obviously you should change actionSend to the action you want, and update IME_ACTION_SEND correspondingly.
Take a look at the
setImeActionLabel
method (orimeActionLabel
andimeActionId
attributes) andsetOnEditorActionListener
to set a listener to respond to the events.