如何添加侦听器到autocompletetextview,android?

我正在尝试添加监听器,当在autocompletetextview上select一个项目时会有反应…任何人都可以帮助// phonename是autocompletetextview

PhoneName.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { Toast.makeText(check.this," selected", Toast.LENGTH_LONG).show(); } public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } }); 

  • 在键入完整单词后按空格键时,AutoCompleteTextView不显示下拉列表
  • AutoCompleteTextView下拉高度限制在对话框popup
  • 如何在Android上自定义AutoCompleteTextView下拉列表
  • AutocompleteTextViewbuild议列表上升
  • 将Snackbar放在最高的z顺序,以避免被AutoCompleteTextView下拉菜单阻塞
  • AutoCompleteTextView失去焦点的问题
  • 自动完成textview谷歌放置API
  • 如何禁用Android AutoCompleteTextView的拼写检查器?
  • 尝试这个:

     phoneName.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View arg1, int pos, long id) { Toast.makeText(check.this," selected", Toast.LENGTH_LONG).show(); } });