android--multi-Select Automatic search Tips

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.