java - Android, how to show software keyboard on click -
i have dialog box in android app; edittext control on dialog (the others spinners , buttons), , gets focus when dialog shown. prevents on-screen keyboard ever showing up, meaning can't enter text box unless have hardware keyboard.
i believe (but couldn't swear it) because control starts focus, , system check whether show keyboard or not happens in onfocus event. there way programmatically show on-screen keyboard?
in order implement ability force keyboard open when user presses button on screen following should help.
inputmethodmanager inputmethmanager = (inputmethodmanager) getsystemservice(context.input_method_service); inputmethmanager.togglesoftinput(inputmethodmanager.show_forced,0);
however alternative regain focus of dialog window can found below. code should open software keyboard resetting flags set alertdialog. code should placed after creation of dialog window.
dialog.getwindow().clearflags(windowmanager.layoutparams.flag_not_focusable|windowmanager.layoutparams.flag_alt_focusable_im);
Comments
Post a Comment