Hello,
I am not sure whether this is a bug or I have a mistake in my code.
When in an empty AutoCompleteTextView I enter one character like 'a',
then
1) the OnKey event does not intercept the pressed key
2) when intercepting it manually within the Onkey event the
showDropDown() method does not work.
CODE:
public boolean onKey(View v, int keyCode, KeyEvent event) {
//...
currentText = myAcView.getText().toString(); // Does not contain the
current pressed character
// 1) Intercept the current pressed character:
char c = (char) event.getUnicodeChar();
currentText = currentText + Character.toString(c);
//...
// 2) Try to show Dropdownlist:
if (!myAcView.isPopupShowing() && !myAcView.getAdapter().isEmpty())
{ // Adapter is not empty, I checked
myAcView.showDropDown(); // Only works if more than one character
entered in AcView ....
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---