Access contact filters

Contacts on an Android phone come with settings, such as Filter Contacts, which allow the user to set things like Show only contacts with phone numbers and Show only contacts that are online, and which contact sets are displayed (for example , only phone, phone and Google etc.).

Wherein

Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
startActivityForResult(intent, PICK_CONTACT);

Is there any way to get these filters applied to my contact list? By default, everything seems to be back. If you can’t, is there a way to access these settings to find out what they are, so I can create my own contact list so that it matches the way the phone user set their default value? This is only needed for Android 2.

(An ideal option is a way to call up a contact picker, which allows the user to also set filters there.)

+5
source share
1 answer

I think that if you pass the URI to an intent like the one shown here , you will need to apply your filter. So you would do something like this:

Intent intent = new Intent(Intent.ACTION_PICK, PhoneLookup.CONTENT_FILTER_URI);
intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
startActivityForResult(intent, PICK_CONTACT);
0
source

All Articles