您的位置:首页 > 移动开发 > Android开发

Android TextField : set focus + soft input programmatically

2013-11-28 14:18 489 查看
Good sir, try this:

edittext.setFocusableInTouchMode(true);
edittext.requestFocus();

Im not sure, but this might be required on some phones (some of the older devices):

finalInputMethodManager inputMethodManager =(InputMethodManager) context
.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.showSoftInput(edittext,InputMethodManager.SHOW_IMPLICIT);


View Code

http://stackoverflow.com/questions/8080579/android-textfield-set-focus-soft-input-programmatically
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: