In my app, I need to catch back key events. With the soft keyboard open, the back button removes the keyboard. Unfortunately, there is no API to reliably detect that the soft keyboard is open, so my app tries to handle the back key. When I try to catch the back button in "dispatchKeyEvent" of my app, I get a key event, although the soft keyboard has already consumed the event, which seems strange. When I override a View object, I can hook my application into the "dispatchKeyEventPreIme" and consume the event before it gets to the soft keyboard, but overriding all my top level views seems not a viable approach. It also seems strange or inconsistent to have an event show up in the view before it shows up in the Activity class, although the documentation claims that it handles the event before it gets to the window.
It would be nice to have the Activity class be able to do the same thing, catch the event before the IME, or have the soft keyboard consume the event, so it doesn't even get to the application, after all, it already did its job. Out of curiosity, is there a reason for why an application can't determine the visibility of the soft keyboard reliably? Thanks, Michael --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

