开发者

Getting focus on an edit text when pressing other view

开发者 https://www.devze.com 2023-04-11 23:17 出处:网络
i have a button and an edit text. I want to press the button and want the action to happen on edit text same that happens when edit text is pressed itself i.e. a keyboard opens f开发者_如何转开发or wr

i have a button and an edit text. I want to press the button and want the action to happen on edit text same that happens when edit text is pressed itself i.e. a keyboard opens f开发者_如何转开发or writing.


You do this on button click,

InputMethodManager mgr = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); mgr.showSoftInput(edit_text, InputMethodManager.SHOW_FORCED); edit_text.requestFocus();

0

精彩评论

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

关注公众号