autocompletetextview setonitemselectedlistener not working

前端 未结 3 1513
生来不讨喜
生来不讨喜 2021-02-06 23:25

there i am trying to write code for authorisation activity. When i am putting some entry in inputEmail i expect that my inputPasword will be fileed automaticly if corresponding

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-06 23:50

    autoCompleteTextView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView parent, View view, int position, long id) {
                String selectedItem=autoCompleteTextView.getAdapter().getItem(position).toString();
                Toast.makeText(getApplicationContext(),selectedItem ,  Toast.LENGTH_SHORT).show();
            }
        });
    

    Just get the adapter of AutoCompleteTextView and use the position.

提交回复
热议问题