Difference between MultiAutoCompleteTextView and AutoCompleteTextView

Can someone explain the difference between MultiAutoCompleteTextView and AutoCompleteTextView ?

+46
android
Feb 03 '11 at 9:05
source share
3 answers

AutocompleteTextView offers only offers for the entire offer, and MultiAutoCompleteTextView offers offers for each token in the offer. You can specify what is the separator between tokens.

 String[] words=new String[] { "word1", "word2", "word3", "word4", "word5" }; MultiAutoCompleteTextView macTv = (MultiAutoCompleteTextView) this.findViewById(R.id.mac_tv); ArrayAdapter<String> aaStr = new ArrayAdapter<String>(this,android.R.layout.dropdown_item,words); macTv.setAdapter(aaStr); macTv.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer() ); 



and

 <MultiAutoCompleteTextView android:id="@+id/mac_tv" android:layout_width="fill_parent" android:layout_height="wrap_content" android:completionThreshold="1" /> 

in this example, a sentence appears after each comma.

+76
Mar 02 2018-11-11T00:
source share

The choice between using AutoCompleteTextView or MultiAutoCompleteTextView comes down to whether the user is allowed to enter only "one element" provided by the adapter, or "several elements".

So, for example, if you are writing an email application and you want the To: field to be an autocomplete field, pulling matches from the address book, perhaps you want to allow the user to select multiple recipients for the message, and make this a MultiAutoCompleteTextView field.

On the other hand, the From: field in the same example email application, you will need to force only one user selection from their configured email accounts. So here it will be appropriate to use AutoCompleteTextView.

+59
Dec 11 '11 at 10:26
source share

Difference between AutoCompleteTextView and MultiAutoCompleteTextView

AutoCompleteTextView Vs MultiAutoCompleteTextView

AutocompleteTextView only offers offers for the entire offer. MultiAutoCompleteTextView offers offers for each token in the offer. You can specify what is the separator between tokens.

AutoCompleteTextView is used to select a single item. MultiAutoCompleteTextView is used to select multiple items using a separator (such as a comma) between them.

From: field in the example email application, you will need to force only one user selection from their configured email accounts. If you are writing an email application and want the To: field to be an autocomplete field, getting matches from the address book, the probability that you want to allow the user to select multiple recipients for the message will be made by this MultiAutoCompleteTextView field

0
Jun 13 '17 at 9:16 on
source share



All Articles