如何使用在类中创建的字符串数组填充autocompletetextview

use*_*035 1 android autocompletetextview

通常在文件夹中AutoCompleteTextView填充文件.谁能告诉我如何使用在类中创建的字符串数组来填充?strings.xmlres/valuesAutoCompleteTextView

Meh*_*oki 12

试试这个...

autocompletetextAdapter = new ArrayAdapter<String>(
                        this,
                        android.R.layout.simple_dropdown_item_1line, stringArray);

myAutocompleteTextView.setAdapter(autocompletetextAdapter);
Run Code Online (Sandbox Code Playgroud)