Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonebook settings (i.e contact only filter) android code example

Tags:

android

I want is to hide all contacts without phone numbers in phonebook from my application.. Just like phonebook do, When you go to phonebook -> settings there is a checkbox which states that "Contacts with phone number only" I want to implement this feature in my app

I need a method (code) to navigate users to phonebook -> settings (activity) (System app)

from my application activity.

or worse case hide all contacts without phone number through database. So that phonebook can filter out.

Currently i found

Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
startActivityForResult(intent, 123);

Above code opens phone book but i want to open phone book -> settings page.

In sum i want to make phonebook contents "contacts with phone numbers" from my application

like image 989
Amir Qayyum Khan Avatar asked Mar 11 '13 11:03

Amir Qayyum Khan


1 Answers

I need a method (code) to navigate users to phonebook -> settings (activity) (System app)

There are hundreds, perhaps thousands, of Android phones. None will necessarily be the same with respect to their "phonebook" app. None of those "phonebook" apps necessarily have the feature you seek -- some may, some many not. And, most likely, none have a documented and supported Intent structure for getting to a screen within the app to control the setting that they may or may not have.

I want is to hide all contacts without phone numbers in phonebook from my application

Then you will need to not use the "phonebook" app, but instead display contacts yourself, via the READ_CONTACTS permission and the ContactsContract ContentProvider.

like image 139
CommonsWare Avatar answered Oct 05 '22 12:10

CommonsWare