What is the difference between text field types
I am new to android. I was stuck on a problem but I finally solved it.
I was using a TextField instead of CompleteTextViewField so whats the difference between these two and when should 开发者_如何学GoI use each one of them?
Thanks
Neither of those classes you mention (TextField
, CompleteTextViewField
) exist. Do you mean EditText
and AutoCompleteTextView
? I think the documentation explains it pretty well:
[AutoCompleteTextView is] An editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.
That is, use it rather than a normal EditText if you have a set of common autocompletions for what gets entered in the box. The docs also link to a full sample that shows how to populate that list of suggestions with an Adapter.
精彩评论