I want to perform an action when enter is pressed in android editText. I have tried various ways of using EditorInfo.IME_ACTION_DONE
, which works, but the problem is, it shows a tick icon, which I don't want. I want it to look like the default enter button on the keyboard.
How do I handle enter pressed event while retaining the "Enter" shape? Is there something like EditorInfo.IME_ACTION_ENTER
to get my job done?
My approach (which shows tick icon):
editorEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
if( (actionId == EditorInfo.IME_ACTION_DONE){
Toast.makeText(EditorActivity.this, "working", Toast.LENGTH_SHORT).show();
return true;
}
return false;
}
});
I want it to look like "Enter" shape because I am making a text editor. I am trying to shift to another EditText
on the "Enter" button is pressed and don't want it to look like a "Tick" button. That's why I don't want the tick symbol.