Android: Using item selected in AutoCompleteTextView to populate another field

前端 未结 2 2070
半阙折子戏
半阙折子戏 2021-02-10 01:47

I am trying to build an app where the names of employees are stored in a table. On a particular page, the user can enter the name of an employee in an autocompletetextview and s

2条回答
  •  有刺的猬
    2021-02-10 02:33

    You can create a custom Adapter for your AutoCompleteTextView which has all the info, say you have a class People(name, department, designation).

    Something like

    autoCompleteTextView.setAdapter(new CustomAdapter(getBaseContext(),  android.R.layout.simple_list_item_1, "a list of all your people"))
    

提交回复
热议问题