简体   繁体   中英

Android AutoCompleteTextView, how to link suggestions to xml?

I am trying to use the suggestions of my AutoCompleteTextView can be click to view my xml layouts.

I have done the xml part.

AutoCompleteTextView
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:id="@+id/autoCompleteTextView1" 
android:layout_gravity="center" 
android:text="Enter keyword to search outlet"

So here are my suggestions :

static final String[] COUNTRIES = new String[] { "Adidas", "Affin", "Alam Art" };

I have them saved as adidas.xml, affin.xml and alamart.xml. So how do i have them to be displayed with the autocomplete?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM