• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Android PopupWindow key event handling when another view is on top

In an Android app, I have a PopupWindow with focusability set to true. This popupWindow is shown when menu button is pressed and it contains menu items. When one of the menu items is clicked, an AutoCompleteTextView is shown to the user. User can type on it to start a search operation. The popupWindow is dismissed when the menu item is clicked. User starts typing through the soft keyboard and text entry works fine.
The problem starts when the user presses "Backspace" key on soft keyboard.Instead of deleting the last entered character in the AutoCompleteTextView, the AutoCompleteTextView itself gets dismissed. On debugging, observed that the Backspace key event (keyCode = 67) gets propagated to the Activity hosting the popupWindow.
The problem doesnot exist when the popupWindow is not dismissed during the selection of menu item. This indicates that the popupWindow consumes the Backspace key event in some way and redirects it properly to the AutoCompleteTextView.
The problem also doesnot exist when the popupWindow focusability is set to false.
Can some one let me know how the popupWindow handles key events when it is dismissed or not dismissed ? Or if someone could throw some light on this , it would be much appreciated.
Thanks for your time.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones