4

I'm using AutoCompleteTextView inside DialogFragment. When it shows a dropdown list, keyboard hides and shows again very fast, it looks like a blink.

As possible solution, I found that it happens because of

AutoCompleteTextView {

    showDropDown(){
       mPopup.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NEEDED);
    }
}

So overriding showDropDown() in this way removes blink

showDropDown(){
    super.showDropDown()
    mPopup.setInputMethodMode(ListPopupWindow.INPUT_METHOD_FROM_FOCUSABLE)
    mPopup.show()
}

But it shows dropdown above keyboard and blocks user input. Maybe someone knows better solution?

Ufkoku
  • 2,094
  • 14
  • 36
  • I'm running into the same problem. Seems to be new to android Q. I'll keep looking, but I got about as far as you did (at which point I came across your question). – etrado Dec 09 '19 at 17:58
  • @etrado I have not found any solution. So I replaced `AutoCompleteTextView` with `TextInputEditText` and a `ListView` (with filterable `ArrayAdapter`) inside `ConstraintLayout` looks ok. But you need to handle `ListView` visibility – Ufkoku Dec 10 '19 at 10:16

1 Answers1

0

You're not going to believe this, but I am pretty sure the December 5 patch to android Q fixed this problem. I got the update this morning, and I was hoping since it was a relatively new issue that they might have addressed it. Turns out they did! I get no more flashing keyboard when using the AutocompleteTextView.

etrado
  • 101
  • 7