How to filter a contact picker intent on the basis of account type

时光怂恿深爱的人放手 提交于 2019-12-09 20:36:55

问题


On applying a picker (implicit) intent, we can show the contacts list, with all the contacts present in the phone. For this we usually use below code :

Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,
                ContactsContract.CommonDataKinds.Phone.CONTENT_URI);
        startActivityForResult(contactPickerIntent, RESULT_PICK_CONTACT);

But what should be done to filter the contacts displayed in the list as per the Account Types. For e.g- if I want to show only the contacts which are registered with whatsapp. What shall be done in this case scenario to show only the whats app registered contacts in the Contacts list.

Note : The particular account type contacts can be retrieved by querying the DB, but in that case we need to create our own contact list to display the filtered contacts. The motive is to use the contact apps list to display the filtered contacts.

来源:https://stackoverflow.com/questions/38741298/how-to-filter-a-contact-picker-intent-on-the-basis-of-account-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!