How to remain keyboard after Done click on EditText in android?
I have some app with EditText.
<EditText
android:id="@+id/et_game_word"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:imeOptions="actionDone"
android:singleLine="true" >
<requestFocus />
</EditText>
When I click Done button on the keyboard, the one hides, but I want to remain keyboard after clicking. Keyboard must be hide only pressing Back button. I tried to add InputMethodManager.SHOW_FORCED to continue showing keyboard, but this doesn't work.
editTextWord.setOnEditorActionListener(new OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
someCode();
inputManager.hideSoftInputFromWindow(
getCurrentFocus().getWindowToken(),
InputMethodManager.SHOW_FORCED);
}
return false;
}
});
How can I do this?
链接地址: http://www.djcxy.com/p/92978.html上一篇: 防止软键盘被解雇