How to assign an AutoCompleteTextView value from a drop-down selected value to another row

Friend I need help setting the content of the data displayed in DropDownlist from automatically completing the text field to another line when I click on specific content from the drop-down list. Help me.

early.

+3
source share
1 answer

I install onitemclicklistener for my AutoFillTextView, and in it I manually setText for AutoCompleteTextView:

    editNumber = (AutoCompleteTextView) findViewById(R.id.editNumber);
    NumberAdapter adapter = new NumberAdapter(
            this, 
            ContactInfo.getContacts(this.getContentResolver()));
    editNumber.setAdapter(adapter);

    editNumber.setOnItemClickListener(this);
    ....

public void onItemClick(AdapterView<?> parent, View view, int position,
        long id) {
    ContactInfo ci = (ContactInfo)parent.getItemAtPosition(position);
    editNumber.setText(ci.Number);
}
+4
source

Source: https://habr.com/ru/post/1771487/


All Articles