开发者

Closing IME onEditorAction

开发者 https://www.devze.com 2023-02-08 07:23 出处:网络
Hey all , first post on Stack so be patient. I am trying to close the IME after user presses enter in Ed开发者_运维知识库itText.

Hey all , first post on Stack so be patient.

I am trying to close the IME after user presses enter in Ed开发者_运维知识库itText.

I've tried using android:imeOptions="actionDone"/"actionNext" in the layout.xml

I've set up setOnEditorActionListener on said EditText and am looking for code to signal IME it's done.

tnx.


This works just fine

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
0

精彩评论

暂无评论...
验证码 换一张
取 消