简体   繁体   中英

android soft keyboard doesn't show

I don't know if this is a programming issue or rather an issue with the phone itself, but I'm testing my app and when testing it on a Galaxy Nexus, when I click on an EditText, SOMETIMES the keyboard doesn't show. No matter how many times I click on it, the keyboard won't pop up. After I close out of the app and re-open it, then the keyboard will show after clicking on the EditText.

I don't get these issues testing my app on a Nexus 7 or any of the emulators. Is this more of a problem with my phone than with my app? If so, won't this be an issue for anyone who owns a Galaxy Nexus and downloads my app?

if you are experiencing issues with your softkeyboard you can use this code to force it to appear:

 if(myEditText.requestFocus())   
    ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);

Hope it helps :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM