简体   繁体   English

如何结合使用微调框编辑文本

[英]how to combine edit text with spinner

I am writing simple login activity. 我正在编写简单的登录活动。 I have login edit text and password edit text. 我有登录编辑文本和密码编辑文本。 I am kepping login and pasword via sharedpreferences. 我正在通过sharedpreferences缩短登录名和密码。 I want to make login field to rember previous logins (eg "aaa" and "aab") so when you type in edit text it give you some options and you can choose them to outo complite it. 我想在登录字段中退格以前的登录名(例如“ aaa”和“ aab”),因此当您输入编辑文本时,它会为您提供一些选项,您可以选择它们以使其简洁。 How it can be done? 怎么做?

You should use AutoCompleteTextView instead of simple EditText check dev link http://developer.android.com/reference/android/widget/AutoCompleteTextView.html 您应该使用AutoCompleteTextView而不是简单的EditText检查开发人员链接http://developer.android.com/reference/android/widget/AutoCompleteTextView.html

also check this link for detail http://www.javatpoint.com/android-autocompletetextview-example 还要查看此链接以获取详细信息http://www.javatpoint.com/android-autocompletetextview-example

You can use AutoCompleteTextView for the login field, and use a suitable adapter to display the values. 您可以将AutoCompleteTextView用于登录字段,并使用合适的适配器来显示值。 If you are remembering the previous login IDs, then, you can store them in SQLite DB and use CursorAdapter to populate the auto complete text view. 如果您记得以前的登录ID,则可以将它们存储在SQLite DB中,并使用CursorAdapter填充自动完成文本视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM