How to get text from AutoCompleteTextView?

前端 未结 9 1738
青春惊慌失措
青春惊慌失措 2020-12-05 04:25

I have an AutoCompleteTextView in my app which works. I have successfully created an onClickItemListener. The question is how to grab the text the

9条回答
  •  遥遥无期
    2020-12-05 04:52

    One another of getting text of suggestion selected in AutoCompleteTextView is

    @Override
    public void onItemClick(AdapterView parent, View view,int position, long id) 
    {
        TextView txtvw=(TextView) view;
        String str=txtvw.getText().toString();
        int index = contactNames.indexOf(str);
    } 
    

提交回复
热议问题