android - How to pick contacts only from google contacts (not facebook etc) with phone numbers? -


I have to fix a bug in my old app. Part of the bug is how do I choose contacts here What do I need :

  1. The contact should be from the 'normal' Google contact list, which means that I do not have any contact with Facebook or similar.
  2. The contact must have at least one phone number.
  3. The contact should be from the old android.provider.Contacts provider.
  4. If I can use the selection list, an intention to bring contact urr without making myself, then it is a bonus.

Looks simple, but I'm really struggling This is what I am trying to:

  @Override Bundle Saved InstantStat) {super.onCreate (SavedInstanceState); Intention = Intention = Intent (Intent.ACTION_PICK, Contact people.contENT_URI); StartActivityForResult (intent, PICK_CONTACT_REQUEST); }  

This works fine. I still see contacts without phone numbers, but I can live with it, worse than that I am still seeing Facebook contacts on the list ! It seems that the following can be found in the contradiction:

The APIs have been moved by ContactsContract. New APIs allow access to multiple integration of multiple accounts and similar contacts. These APIs continue to work, but will only restore data for the first Google account, which matches the basic behavior.

This is exactly what I wanted, but sorry, what I got is not what I got.

Finally, here are my solid questions which I hope someone can answer:

  1. Android. Why am I seeing Facebook contacts while using the provider? Contact content provider?
  2. If this does not work, how can I select a Google contact with a phone number to the user?

Many thanks. Gustav

I have a similar problem, at least it gives you contact with phone number ( Facebook is included) ...

  intent = new intent (Intent.ACTION_PICK); Intent.setType (ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE); StartActivityForResult (intent, PICK_CONTACT_REQUEST);  

Comments