你知道我怎麼能得到觸發事件的視圖? 例如:如何獲取在Android中觸發事件的視圖?
final AutoCompleteTextView edtxInput = (AutoCompleteTextView)layout.findViewById(R.id.edtx_input);
edtxInput.setThreshold(2);
edtxInput.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View arg1, int position, long arg3) {
Console.debug(TAG, "view: " + arg1, Console.Liviu);
edtxInput.setText(((FormOption)edtxInput.getAdapter().getItem(position)).getDescription());
}
});
這裏的問題是,我不知道我怎麼可以更新從edtxInput在OnItemClickListener文本沒有使它決賽。
感謝
謝謝你的回答。你知道爲什麼不可能像這樣(AutoCompleteTextView)父項? Eclipse給我一個錯誤「無法從AdapterView轉換爲AutoCompleteTextView」。 –
對不起給我5分鐘測試它我自己並正確地發佈代碼 – weakwire
更新了我的答案 – weakwire