<AutoCompleteTextView
android:id="@+id/autoTextview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<MultiAutoCompleteTextView
android:id="@+id/mul"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
private AutoCompleteTextView auto;
private MultiAutoCompleteTextView mul;
auto = (AutoCompleteTextView)findViewById(R.id.autoTextview);
String[] autoStrings = new String[]{
"联合国","联合国安理会","联合国五个常任理事国","Google","Google Map"
};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(
getApplicationContext(),
android.R.layout.simple_dropdown_item_1line,
autoStrings);
auto.setAdapter(adapter);
mul = (MultiAutoCompleteTextView)findViewById(R.id.mul);
mul.setAdapter(adapter);
mul.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());