android - Softkeyboard in Fragment does not show for edittext -


i have simple application 2 fragments. right fragment being replaced. edittext inside has requestfocus, not show keyboard.

on android 4.2.2 works fine, on 2.3.x not, neither in emulator nor on real device. on emulator can type windows keyboard although soft keyboard not showing.

i have not hidden keyboard on purpose. showing keyboard following code works 4.2.x.

inputmethodmanager imgr = (inputmethodmanager) getactivity().getsystemservice(context.input_method_service); imgr.togglesoftinput(inputmethodmanager.show_forced, inputmethodmanager.hide_implicit_only); 

any hint?

doing more research have found following.

since need focus on edittext, first remove focus , put back:

@override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) {         myfilter.clearfocus(); }  @override public void onactivitycreated(bundle savedinstancestate) {     super.onactivitycreated(savedinstancestate);      myfilter.requestfocus(); } 

the keyboard not shown, once user clicks on edittext, comes up.

this still not work on 2.3 emulator, works on real device. seems kind of 2.3 bug.


Comments