my AutoCompleteTextView is created with a custom adapter to show suggestions for ~3000 Strings. while typing in the input view, suggestions are coming up as expected, except that sometimes a chunk of the dropdown view with suggestions is being clipped or looks like its detached from the AutoCompleteTextView. this extra chunk of the dropdown apears to be holding previous suggestions that are no longer relevent. upon clicking a suggestion or typing more letters - the "stuck" dropdown piece disapears.
edit: i find that once the AutoCompleteTextView is only showing one suggestion after showing more than one, the problem occurs
Why is this happening? How can i fix it?
Right now i am trying a few things(none of which are working):
-adding a TextWatcher on the AutoCompleteTextView and invalidating the AutoCompleteTextView in the onTextChanged method.
-getWindow().getDecorView().invalidate(); on the Activity containing this AutoCompleteTextView in the onTextChanged method
edit: this is only happening on the samsung galaxy s phone running 2.1 sdk version 7
Related
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?
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.
Just found myself trying to figure out this strange behavior in for EditText.
Information:
Bug seems to only happen in some devices! for now I've only seen it in Sony Xperia D2303.
App description:
I'm working on an app that has a main activity and navigation is done trough different fragments that are replaced as user moves from one section to another.
At one point I'm showing a DialogFragment with an edit text field, with background set to #null, with a hint text. (I have also tried with a normal edit text, taken from widget list and dragged to the layout and found the same behavior).
Problem:
When clicking on the EditText, software keyboard SHOWS UP but when typing there is no letter input in the EditText! I can long press, to visualize cursor position marker and also the magnifying glass shows up.
Things I've tried:
- I've tried requesting focus with xml, programmatically.
- Setting touchable(in touch mode also)
- Setting descendantFocusability attribute of parent to 'afterDescendants'
- Overriding onTouchListener and showing keyboard programmatically through the InputManager and using the edit text's token
… and maybe other things which I don't remember
There is but a workaround that I've found!!! sending the app to background, and bringing it to foreground again… so it seems something related to focus maybe?? but then why does keyboard show up, and cursor marker and magnifying glass work?
This solution does not work for me as it depends on the user taking action
Has anyone found this problem? any suggestions?
Thanks in advance!
I have a AutocompleteTextView. Suggests List will appear on typing 3 characters.Suggest list size to be be fixed i.e. 8 . Every thing is working fine except the suggest list getting overlapped with soft keyboard.
I am attaching the screen shots for the same
What should be done, suggestions please.
Thanks in advance.
Try setting android:dropDownHeight
I have a MultiAutoCompleteTextView implemented on one of my screens. I was testing the application in various smartphones and when I tested in a smartphone that had XT9 turned on the texbox works, however when the word was selected in my textbox the XT9 does not clean the letters already typed, then when I started to type again the previous letters from the first word show up.
So I need to turn of XT9 in this screen or clean XT9 letters list. Someone knows how to do it?
Thanks
I found that to disable the autocomplete of the Input I just needed to add the attribute android:inputType="textAutoComplete" on the MultiAutocompleteTextView's xml
I know it's been asked around but I haven't found quite the answer yet (new to Android so sorry about the ignorance)
my app's launch Activity has an EditText (called searchbox) , a ListView (designations) and a Spinner (types)
I use the EditText as a searchbox, I have to pass the string through a custom editing to make searching more flexible. After that I match that against the closest approximation I find in 'designations' and do
designations.setSelection(j);
As expected, this sets the desired item to the top of designations. But I can't find a way to highlight it via code.
NOW, i do know that if the device is in touch mode the highlighting of a selected item won't occur. So the last 4 lines of my searchbox's onTextChanged event are:
designations.setFocusable(true);
designations.setFocusableInTouchMode(true);
if (match==true) designations.setSelection(j);
if (st.length()==0) designations.setSelection(0);
to no avail.
now, i don't have any code on searchbox's afterTextChanged(Editable s);
so could anyone give me a clue on this?
regards
~dh
check out requestFocus() and maybe requestChildFocus()
Have you tried setting the actual View to be selected?
designations.setSelection(j);
designations.getSelectedView().setSelected(true);