Intent.ACTION_PICK returns empty cursor for some contacts

倖福魔咒の 提交于 2019-12-04 23:52:52

You cannot access FB contacts through the Contacts API.

To fix the crash you should check the result of moveToFirst() like this:

String number = null;
if (cursor.moveToFirst()) {
   number = cursor.getString(0); // 0 matches the index of NUMBER in your projection.
}

To explore the nature of the data that is available to you I would pass in "null" for the projection so that all of the fields come back, and dump the field names and values. You may find the data you are looking for, just not in the NUMBER field.

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