Android TextField : set focus + soft input programmatically

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
posted @ 2013-11-28 14:18  花开花落云卷云舒  阅读(354)  评论(0编辑  收藏  举报