What version of Android are you planning? I can't post a comment sorry (new account), but I'm currently doing a test test to answer your question.
EDIT: Alright, I figured it out. After a few search queries (see this question ) and coding, I found that imeOptions seem to be cached / bound to the input method. I'm not sure if this is a bug or intentional functionality. To switch the keyboard when the user clicked on one of the switches, first make sure inputType is set for your EditText ( android:inputType="text" ), and then use the following onCreate method:
final RadioGroup btn_group = (RadioGroup) findViewById(R.id.btn_group); final RadioButton btnA = (RadioButton) findViewById(R.id.btnA); final RadioButton btnB = (RadioButton) findViewById(R.id.btnB); btn_group.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { final EditText txtSearch = (EditText) findViewById(R.id.edit_text); txtSearch.setInputType(InputType.TYPE_NULL); if(btnA.isChecked()) { txtSearch.setImeOptions(EditorInfo.IME_ACTION_DONE); } else { txtSearch.setImeOptions(EditorInfo.IME_ACTION_SEARCH); } txtSearch.setInputType(InputType.TYPE_CLASS_TEXT); } });
Note the nulling and reconfiguration of InputType.


Finally, keep in mind that many popular keyboard implementations don't give a damn about the fact that you installed imeOptions , so don't rely on this functionality in your application. For example, Swype;

In conclusion (see what I did there?), In order to keep up, I linked my test program. You can find it here: http://dl.dropbox.com/u/52276321/ChangeKeyboardTest.zip
source share