AutoCompleteTextView item selection programmatically

前端 未结 9 2053
故里飘歌
故里飘歌 2021-02-18 14:41

I have an autocomplete text view that is filled with cities from an sqlite database that calls an async task on item click, recently I added an option to detect my location usin

9条回答
  •  情书的邮戳
    2021-02-18 14:58

    I was facing a similar problem and this solved my issue. Important is to call setText(, ) in order not to filter with the given text set the second parameter with false. The text will be got from the dropdown adapter.

    Solution snippet:

    automCompleteTextView.setText(automCompleteTextView.getAdapter().getItem(position).toString(), false);
    

提交回复
热议问题