當前位置:成語大全網 - 漢語詞典 - autocompletetextview在Android開發中如何不能自動顯示?

autocompletetextview在Android開發中如何不能自動顯示?

適配器寫的有問題。我從未使用過定制適配器。之前直接用arrayadapter設置的。

//初始化適配器

array adapter adapter = new array adapter & lt;字符串& gt(getApplicationContext(),

安卓。r . layout . simple _ drop down _ item _ 1 line,all _ list);

//為autocomplete控件設置綁定適配器

et.setAdapter(適配器);

先用arrayAdapter試試看是不是適配器的問題。再次承諾,看看cursor獲取數據有沒有問題。