Wednesday, June 2, 2010

[android-developers] Re: AutoCompleteTextView woes

Use the dismiss method.

For dismissing, dismissDropDown()
For showing, showDropDown()

Thanks and Regards,
Kumar Bibek

On Jun 2, 6:05 am, Zsolt Vasvari <zvasv...@gmail.com> wrote:
> If I programatically set the value of an AutoCompleteTextView using
> setText() and the view happens to have focus, the drop down will show
> automatically.  Is there an officially senctioned way of prevent this
> from happening?
>
> Right now, I hacked around the problem by clearing the adapter first,
> but it's a horrible kludge and it's probably a bug in
> AutoCompleteTextView that it actually works:
>
> ArrayAdapter<CharSequence> adapterSave =
> (ArrayAdapter<CharSequence>)textView.getAdapter();
> textView.setAdapter((ArrayAdapter<CharSequence>)null);
> textView.setText(text);
> textView.setAdapter(adapterSave);
>
> Is there a better way?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment