标签:
<AutoCompleteTextView
android:id="@+id/autoCompleteTextView"
android:completionThreshold="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入"
/>
private String[] resourcesStrings = {"beijing1","beijing2","beijing3"};
//单个
autoCompleteTextView = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, resourcesStrings);
autoCompleteTextView.setAdapter(adapter);
//多个
multiAutoCompleteTextView = (MultiAutoCompleteTextView)findViewById(R.id.t2);
multiAutoCompleteTextView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
multiAutoCompleteTextView.setAdapter(adapter);
标签:
原文地址:http://www.cnblogs.com/qizhelongdeyang/p/5161110.html