码迷,mamicode.com
首页 > 移动开发 > 详细

android 智能提示

时间:2016-06-22 20:25:37      阅读:268      评论:0      收藏:0      [点我收藏+]

标签:

<AutoCompleteTextView
android:id="@+id/autoCompleteTextView"
android:completionThreshold="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入"
/>

 

 

private String[] resourcesStrings = {"beijing1","beijing2","beijing3"};

//单个

autoCompleteTextView = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, resourcesStrings);
autoCompleteTextView.setAdapter(adapter);

//多个

multiAutoCompleteTextView = (MultiAutoCompleteTextView)findViewById(R.id.t2);
multiAutoCompleteTextView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
multiAutoCompleteTextView.setAdapter(adapter);

 

android 智能提示

标签:

原文地址:http://www.cnblogs.com/qizhelongdeyang/p/5161110.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!