简体   繁体   English

android软键盘不显示

[英]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. 我不知道这是编程问题还是手机本身的问题,但是我正在测试我的应用,并且在Galaxy Nexus上进行测试时,当我单击EditText时,有时键盘不显示。 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. 关闭应用程序并重新打开它后,单击EditText后将显示键盘。

I don't get these issues testing my app on a Nexus 7 or any of the emulators. 在Nexus 7或任何模拟器上测试我的应用程序时,我没有遇到这些问题。 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? 如果是这样,这对于拥有Galaxy Nexus并下载我的应用的人来说不是问题吗?

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 :) 希望能帮助到你 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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