Domanda

In Android Google Mail app, when you start typing into the "To:" field in a new email, you will get a dropdown menu, auto-populated from your contacts.

I want this behavior in my app.

Currently, when my users enter an email address, they have to type the whole thing (into, essentially, an "textEmailAddress" input field). I want to make things easier by providing contacts-based predictive entry, Google-Mail-style.

How do I do this?

(So far, I have 1. googled, 2. looked through Android SDK documentation, 3. looked through Android sources (http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android/).)

È stato utile?

Soluzione

You have 2 things to do

1) Get All Contact's Email ID See this Blog and Also can Search for more exapmles After getting the Email IDs Store them in An Array say emailArray

2) Use the emailArray to show in an AutoCompleteTextView

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top