public class MainActivity extends Activity {
private AutoCompleteTextView mAutoCompleteTv;
private MultiAutoCompleteTextView mMultiAutoCompleteTv;
private String[] complete={"haha","heihei","hehe","hanhan"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mAutoCompleteTv = (AutoCompleteTextView) findViewById(R.id.auto_complete_tv);
mMultiAutoCompleteTv = (MultiAutoCompleteTextView) findViewById(R.id.multi_auto_complete_tv);
mAutoCompleteTv.setAdapter(new ArrayAdapter<>(this,android.R.layout.simple_dropdown_item_1line,complete));
mMultiAutoCompleteTv.setAdapter(new ArrayAdapter<>(this,android.R.layout.simple_dropdown_item_1line,complete));
mMultiAutoCompleteTv.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
}
}