ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(Application.getContext(), R.layout.report_add_list_item, ListUtil.asStringList(ContactServiceUtil.getContacts()));
multiAutoCompleteContacts = (MultiAutoCompleteTextView) findViewById(R.id.multiAutoCompleteGuests);
multiAutoCompleteContacts.setAdapter(adapter1);
multiAutoCompleteContacts.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
multiAutoCompleteContacts.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
System.out.println("click");
}
public void onNothingSelected(AdapterView<?> adapterView) {
return;
}
});
我没有进入onItemSelected方法。我需要通过位置获取已选择的列表项,以获取其ID。