Automatic filling based on AutoCompleteTextView in Android

Now we use Baidu or Google to search information on the Internet. When we enter one or two words in the input box, we will automatically prompt the information we want. This effect is designed by Android's AutoCompleteTextView widget with arrayadapter, which is similar to the effect of Google search prompt

First lay out an AutoCompleteTextView widget in the layout, then put the preset string array into the arrayadapter, and finally use the autocompletetextview.setadapter method to make AutoCompleteTextView have the function of automatic prompt. For example, as long as you enter AB, all string lists containing AB will be brought out automatically

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>