android 字符串选择,android-如何从下拉选择的值中将AutoCompleteTextView的值分配给另一个String...

朋友的

当我单击下拉列表中的特定内容时,我需要将自动完成文本框的下拉列表中显示的数据内容设置为另一个字符串的帮助.

帮我.

提前致谢.

解决方法:

我为AutoCompleteTextView设置了onitemclicklistener,并在其中为AutoCompleteTextView手动设置了setText:

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);

}

标签:android

来源: https://codeday.me/bug/20191105/1997201.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值