显示一个下拉最近输入的文本列表时,在Android编辑框中点击 [英] Show a drop down list of recently entered text when clicks on an android edit box

查看:105
本文介绍了显示一个下拉最近输入的文本列表时,在Android编辑框中点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要显示一个下拉最近输入的文本列表,当用户编辑text.Example是登录页面显示$ P $的用户登录pviously

I have to show a drop down list of recently typed texts when the user edits the text.Example is the login pages shows previously logged in users

推荐答案

您正在寻找AutoCompleteTextView的http://developer.android.com/reference/android/widget/AutoCompleteTextView.html

You are looking for the AutoCompleteTextView http://developer.android.com/reference/android/widget/AutoCompleteTextView.html

创建登录的列表

当用户登录时,你需要在登录保存到某种持久性存储(数据库,文本文件)。

When a user logs in, you need to save that login to some sort of persistent storage (database, text file).

创建自动完整列表

每当你创建一个登录的EditText的形式

Everytime you create the form with the EditText login


  1. 从数据库中提取previous登录值

  2. 创建一个字符串数组掉那些previous登录值

  3. 创建一个数组适配器从String数组的

  4. 附加阵列适配器连接到您的AutoCompleteTextView。

这篇关于显示一个下拉最近输入的文本列表时,在Android编辑框中点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆