I am writing simple login activity. I have login edit text and password edit text. I am kepping login and pasword via 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. How it can be done?
Asked
Active
Viewed 1.5k times
2
-
3use auto complete textview. http://stackoverflow.com/a/15877582/1168654 – Dhaval Parmar Jun 04 '13 at 10:35
-
you answer was first with link to proper example, i'd like to rate your comment as solution, please post it as answer – Yarh Jun 04 '13 at 16:02
-
1no need to do that just give +1 on that ans... thanks.. – Dhaval Parmar Jun 05 '13 at 05:04
2 Answers
3
You should use AutoCompleteTextView instead of simple EditText check dev link http://developer.android.com/reference/android/widget/AutoCompleteTextView.html
also check this link for detail http://www.javatpoint.com/android-autocompletetextview-example

pedroremedios
- 763
- 1
- 11
- 39

Shakeeb Ayaz
- 6,200
- 6
- 45
- 64
1
You can use AutoCompleteTextView for the login field, and use a suitable adapter to display the values. 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.

Wand Maker
- 18,476
- 8
- 53
- 87