I wanted a numeric keypad that had a go or done button that closed and executed a calculation class. Thanks to a tip from commonware on where to start I got this working beautifully on the emulator. Then I came to load it on to my HTC desire for testing and it doesn't work at all. I'm sure it must be because of HTC sense having it's own ime but there must surely be a way to make this work on HTC phones? Anyone else managed to get around this issue?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I am detecting whether the DONE / GO / RETURN button has been pressed using an onEditorActionListener, but checking for IME options and KeyEvents to cover HTC keyboards as well as any keyboards that accept IME options.
(This code works for HTC Incredible keyboards as well any keyboard that has IME options)
I was using an EditText with inputType="number" and solved the problem by modifying Asha's solution:
The focus was removed in order to stop showing the number pad. The imm was required because a soft keyboard was still present even after clearing focus.
I can replicate what I think you are seeing on the HTC Incredible.
Not all soft keyboards will support the IME action button. Some, like the Graffiti soft "keyboard", may have no buttons at all, let alone an IME action button. Even the Compatibility Definition Document says nothing about requiring such an action button for the keyboards supplied with a device.
Hence, you should not rely on the IME action button. If it is there, users can use it. However, always have some other means of accomplishing whatever your goal is.