Intent.ACTION_PICK returns empty cursor for some contacts Intent.ACTION_PICK returns empty cursor for some contacts sqlite sqlite

Intent.ACTION_PICK returns empty cursor for some contacts


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.