2012-02-21 76 views
3

金額未設置爲EditText,僅存儲在另一個外部變量中。從自動完成文本視圖中的onitemselect獲取值

productAtoComplete.setOnItemClickListener(new OnItemClickListener(){ 
    public void onItemClick(AdapterView<?> parent, View view, int position, long id){ 
     amount.setText(map.get((String) parent.getItemAtPosition(position))); 
    } 
}); 

回答

1

做到這一點的方法:

amount.setText(map.get(position)); 

或者這樣說:

amount.setText((String) parent.getItemAtPosition(position)); 
相關問題