Can someone explain the difference between MultiAutoCompleteTextView
and AutoCompleteTextView
?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
The choice between using the AutoCompleteTextView or the MultiAutoCompleteTextView comes down to whether or not the user should be allowed to input only "one item" as provided by the adapter, or "multiple items."
So for example, if you were writing an email app, and you wanted the "To:" field to be an autocomplete field, pulling matches from an address book, chances are you want to allow the user to pick multiple recipients for a message, and would make this field a MultiAutoCompleteTextView.
On the other hand, the "From:" field in the same example email app, you would need to enforce only a single selection by the user from their configured email accounts. And so an AutoCompleteTextView would be appropriate here.
AutocompleteTextView
only offers suggestions about the whole sentence andMultiAutoCompleteTextView
offers suggestions for every token in the sentence. You can specify what is the delimiter between tokens.and:
with this example the suggestion comes after every comma.
Difference between AutoCompleteTextView and MultiAutoCompleteTextView
AutoCompleteTextView Vs MultiAutoCompleteTextView
AutocompleteTextView only offers suggestions about the whole sentence MultiAutoCompleteTextView offers suggestions for every token in the sentence. You can specify what is the delimiter between tokens.
AutoCompleteTextView is used for selecting single Item MultiAutoCompleteTextView is used for for selecting multiple Items by using a delimiter(such as comma) in betwwen them.
the “From:” field in example of email app, you would need to enforce only a single selection by the user from their configured email accounts. If you were writing an email app, and you wanted the “To:” field to be an autocomplete field, getting matches from an address book, chances you want to allow the user to pick multiple recipients for a message, and would make this field a MultiAutoCompleteTextView