随笔提示文本
2016-05-28 16:09
260 查看
1. Demo.javapublic class Demo extends AppCompatActivity {
private static final String DATA[] = new String[] {
"hello","hello ok","hello nihao","hello waitting","hello banana" //自动提示信息
};
private AutoCompleteTextView myauto = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_progress_activity_demo);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_dropdown_item_1line,DATA);
this.myauto = (AutoCompleteTextView)super.findViewById(R.id.myauto);
this.myauto.setAdapter(adapter);
}
}
2. activity_demo.xml 自动填充文本<AutoCompleteTextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/myauto"/>
private static final String DATA[] = new String[] {
"hello","hello ok","hello nihao","hello waitting","hello banana" //自动提示信息
};
private AutoCompleteTextView myauto = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_progress_activity_demo);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_dropdown_item_1line,DATA);
this.myauto = (AutoCompleteTextView)super.findViewById(R.id.myauto);
this.myauto.setAdapter(adapter);
}
}
2. activity_demo.xml 自动填充文本<AutoCompleteTextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/myauto"/>
相关文章推荐
- c实现哈希查找
- PHP 正则表达式
- Maven配置一键部署远程Tomcat
- C++之菱形继承
- 给VC++6.0加快捷注释和取消注释
- 九九乘法表及其扩展
- 100~200之间的素数(及其四个优化方案)
- 交换两个变量的四种方案(面试题)
- 统计二进制中1的个数(四种方案)
- JSP系列:(6)JSP进阶-模仿JSTL核心(core)标签库
- C注释转换到C++注释项目
- 冒泡排序(数组方法和指针方法)
- 单链表中查找倒数第K个节点
- 合并两个已序单链表
- 单链表的折半查找,冒泡排序,选择排序
- C++:继承
- 指针和引用的区别
- Why? 在C++中调用被C编译后的函数,要在声明的前面加extern &quot;C&quot;
- C++中赋值函数和拷贝构造函数(举例说明)
- 如何理解虚表及其计算含虚函数的类的大小