Retrieving a phone number with ContactsContract in Android - function doesn't work
I wrote the following function in order to retrieve one single phone number that belongs to the contact with id "contactID". The function which is to retrieve the phone number: private String getContactPhone(String contactID) { Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI; String[] projection = null; String where = ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = ?"; String[] selectionArgs = new String[] { contactID }; String sortOrder = null; Cursor result = managedQuery(uri, projection, where, selectionArgs, sortOrder); if (result.moveToFirst()) { String phone = result