当前位置:网站首页>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>
边栏推荐
- ReferenceError: __ dirname is not defined in ES module scope
- Fabric上搭建Hyperledger caliper进行性能测试
- 应用程序池已被禁用
- SQlife(数据库)
- Adhering to the integration of software and hardware, one Hengke makes efforts to the intelligent educational robot market
- Remember an unprepared internship interview
- Uncover the mystery of Qualcomm ultrasonic fingerprint being "cracked by film"
- MySQL time zone problem
- 【深度学习基础知识 - 42】逻辑回归详解
- 坚持软硬一体化,一恒科发力智能化教育机器人市场
猜你喜欢

rxbinding

MarqueeTextview(跑马灯)

应用程序池已被禁用

GestureOverlayView(手势识别2)

访问控制

A lock faster than read-write lock. Don't get to know it quickly
![[basic knowledge of deep learning - 46] Bayesian theorem and conditional probability formula](/img/9f/b9d7503404e068495fd8613df29366.png)
[basic knowledge of deep learning - 46] Bayesian theorem and conditional probability formula

vlan试验2021.1.14

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

JS find all nodes sibling childNodes children
随机推荐
pytorch tensor的基本函数
台积电5nm即将量产:苹果A14独占7成产能,华为麒麟1020拿下3成
Intel's process roadmap for the next 10 years is exposed: 1.4nm process will be launched in 2029! How?
GridView(实现表格显示图标)
反超华为?爱立信已拿下超过75份5G商用合同
[basic knowledge of deep learning - 38] the difference between L1 regularization and L2 regularization
Detailed explanation of the underlying data structure of redis
[basic knowledge of deep learning - 37] solve the imbalance between positive and negative samples
爱立信承认在中国等五国行贿,向美支付10.6亿美元罚款
发布自己的npm组件库
What's new in helix QAC 2022.2, the ace code static testing tool (2)
[basic knowledge of deep learning - 39] comparison of BN, LN and WN
【深度学习基础知识 - 43】优势比的概念
Intent(有无返回值得跳转)
下放三星3J1传感器:代码暗示Pixel 7人脸识别安全性将大增
Binary search tree
JS 寻找所有节点sibling childNodes children
【华为云Stack】【大架光临】第13期:管理区解耦架构见过吗?帮政企客户搞定大难题
【深度学习基础知识 - 37】解决正负样本不均衡 Focal Loss
【深度学习基础知识 - 50】PCA降维 主成成分分析