One.
Common effects, after the search prompt is selected, you can continue searching for add, the selected terms are separated by special characters
Two. Layout code
< Multiautocompletetextview Android:id = "@+id/automulti" android:layout_width= "Match_parent" android:layout_height= "60DP" android:layout_margintop= "50DP" />
Three. Setting up a data source
Private void bind () { Multiautocompletetextview autoText=(Multiautocompletetextview) Findviewbyid ( R.ID.AUTOMULTI); Arrayadapter<String> adapter=new arrayadapter<string> (this, Android. R.layout.simple_dropdown_item_1line, items); Autotext.setadapter (adapter); Autotext.setthreshold (1); Autotext.settokenizer (new Multiautocompletetextview.commatokenizer ());}
This usage is basically consistent with the autocompletetextview of the previous article, but adds a token split question later
Four. The search term is not displayed in the test
As above, in the search for the entry is present, the Search prompt box appears, but not the contents of the prompt box, which is mainly due to the Android theme, because the color of the conflict caused the content can not be displayed
Here's how to fix it:
< Application Android:allowbackup = "true" android:icon= "@drawable/ic_launcher" android:label= "@string/app_name" android:theme= "@style/apptheme">
Remove or replace the above code theme Android:theme= "@style/apptheme" in the Androidmanifest.xml file with a different theme.
android--multi-Select Automatic search Tips