当前位置:网站首页>AutoCompleteTextView (input box pre match)
AutoCompleteTextView (input box pre match)
2022-07-27 19:52:00 【Ashurol】
//AutoCompleteTextView,MultiAutoCompleteTextView The difference between :MultiAutoCompleteTextView Delimiters can be defined , Match multiple items .
public class MainActivity extends ActionBarActivity {
AutoCompleteTextView auto1;
MultiAutoCompleteTextView auto2;
String res[]={"nihao","hello","hi"};
String res2[]={"zhangsan","lisi","laowang"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
auto1=(AutoCompleteTextView) findViewById(R.id.autoCompleteTextView1);
ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,res);
auto1.setAdapter(adapter);
auto2=(MultiAutoCompleteTextView) findViewById(R.id.multiAutoCompleteTextView1);
ArrayAdapter<String> adapter2=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,res2);
auto2.setAdapter(adapter2);
// Set the character that ends with a comma as the separator
auto2.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
}
}<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.xin.autocompletetextview.MainActivity" >
<AutoCompleteTextView
android:id="@+id/autoCompleteTextView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint=" Please enter the content " >
</AutoCompleteTextView>
<MultiAutoCompleteTextView
android:id="@+id/multiAutoCompleteTextView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint=" Please enter the contact " >
</MultiAutoCompleteTextView>
</LinearLayout>
边栏推荐
- 文件操作防护
- Publish your own NPM component library
- Incluxdb series (III) detailed explanation of incluxdb configuration file
- The first Xiaolong 765G! Redmi K30 5g release: support 5g dual-mode 120Hz screen, priced from 1999 yuan
- [daily accumulation - 06] view CUDA and cudnn versions
- 注入攻击
- [Huawei cloud stack] [shelf presence] issue 13: have you seen the decoupling architecture of the management area? Help government and enterprise customers solve big problems
- [basic knowledge of deep learning - 43] concept of odds ratio
- HDU1323_ Perfection [water question]
- RadioGroup(单选框)
猜你喜欢

SharePreference(存储)

AutoCompleteTextView(输入框预匹配)

Fabric上搭建Hyperledger caliper进行性能测试

MarqueeTextview(跑马灯)

Detailed explanation of the underlying data structure of redis

ArrayAdapter(数组适配器)与SimpleAdapter(简单适配器)

A lock faster than read-write lock. Don't get to know it quickly

UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xff in position 0: invalid start byte

Hyperledger caliper is built on fabric for performance test

【深度学习基础知识 - 37】解决正负样本不均衡 Focal Loss
随机推荐
Count the six weapons of the domestic interface cooperation platform!
王牌代码静态测试工具Helix QAC 2022.2中的新增功能(2)
[basic knowledge of deep learning - 49] kmeans
rxbinding
Release Samsung 3J1 sensor: the code implies that the safety of pixel 7 face recognition will be greatly increased
PyTorch报CUDA error: no kernel image is available for execution on the device 错误
发布自己的npm组件库
IDEA:解决代码没有提示问题
Unity-FairyGUI播放视频(Lua)
【深度学习基础知识 - 40】CNN为什么比DNN在图像领域更具优势
查看宝塔PHP扩展目录
Application pool has been disabled
文件操作防护
Incluxdb series (III) detailed explanation of incluxdb configuration file
Map and set
Introduction to socke programming
Install Talib Library under Anaconda
5W bonus pool / for colleges and universities, 2022 legal science and technology innovation competition is in progress
爱立信承认在中国等五国行贿,向美支付10.6亿美元罚款
Detailed explanation of the underlying data structure of redis