0
我使用淹没菜单创建输入,该菜单使用用户输入从服务器获取数据并将数据添加到列表中。AutoCompleteTextView监听器
我得到这个代码:
from_autocompl = (AutoCompleteTextView)rootView.findViewById(R.id.from_autocompl);
from_autocompl.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
new JSONParse().execute();
if (ImDoneWithJSON == 1)
{
ArrayAdapter<List_From_JSON> adapter = new ArrayAdapter<List_From_JSON>(
this, android.R.layout.simple_list_item_1, data);
from_autocompl.setAdapter(adapter);
ImDoneWithJSON = 0;
}
}
});
现在,我得到的问题是: 我需要知道的是点击这在下拉列表中的项目。
通常它是通过使用onItemClick
做,但我已经有TextWatch
听众加入到from_autocompl
和Android允许在默认情况下只有一个听众,现在我想知道如何做到这一点。如何通过这个?