I have this EditText :
<EditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/name"
android:inputType="textCapSentences"
android:gravity="center"
android:imeActionId="@+id/action_done"
android:imeOptions="actionDone">
<requestFocus/>
</EditText>
and this is the code inside my class that extends Dialog :
name.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
Log.d(TAG, "name action performed");
if (actionId == R.id.action_done) {
ok.performClick();
return true;
}
return false;
}
});
I am looking to perform a custom action when the editor button is clicked, namely call the OnClick() method of the ok button.
However, onEditorAction() never gets called.
What am I doing wrong?