Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

take the value from onitemselect in autocompletetextview

Tags:

android

amount is not being set to EditText, only stores in another external variable.

productAtoComplete.setOnItemClickListener(new OnItemClickListener(){
    public void onItemClick(AdapterView<?> parent, View view, int position, long id){
        amount.setText(map.get((String) parent.getItemAtPosition(position)));
    }
});
like image 332
Harsha Avatar asked Nov 18 '25 01:11

Harsha


1 Answers

Do this way:

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

or this way:

amount.setText((String) parent.getItemAtPosition(position));
like image 76
Adil Soomro Avatar answered Nov 19 '25 13:11

Adil Soomro