2

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?

Yarh
  • 4,459
  • 5
  • 45
  • 95

2 Answers2

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