ime

How do I handle ImeOptions' done button click?

跟風遠走 提交于 2019-11-26 12:45:55
I am having an EditText where I am setting the following property so that I can display the done button on the keyboard when user click on the EditText. editText.setImeOptions(EditorInfo.IME_ACTION_DONE); When user clicks the done button on the screen keyboard (finished typing) I want to change a RadioButton state. How can I track done button when it is hit from screen keyboard? I ended up with a combination of Roberts and chirags answers: ((EditText)findViewById(R.id.search_field)).setOnEditorActionListener( new EditText.OnEditorActionListener() { @Override public boolean onEditorAction

How do I handle ImeOptions' done button click?

冷暖自知 提交于 2019-11-26 03:06:28
问题 I am having an EditText where I am setting the following property so that I can display the done button on the keyboard when user click on the EditText. editText.setImeOptions(EditorInfo.IME_ACTION_DONE); When user clicks the done button on the screen keyboard (finished typing) I want to change a RadioButton state. How can I track done button when it is hit from screen keyboard? 回答1: I ended up with a combination of Roberts and chirags answers: ((EditText)findViewById(R.id.search_field))