Obtaining phone number from lookup URI
I've been trying to obtain a contact's phone number using their lookup URI, but I'm not getting it to work. Cursor myC = getContentResolver().query(lookupURI, null, null, null, null); String phoneNumber; if (myC.moveToFirst()) { while (myC.moveToNext()) { phoneNumber = myC.getString(myC .getColumnIndex(Phone.NUMBER)); Log.v("t", "phone number is: " + phoneNumber); } } where lookupURI.toString() is this URI: content://com.android.contacts/contacts/lookup/0r1-304846522C3052482C4A3442423C3248/1 Anyone knows what I'm doing wrong? Can't guarantee this'll work for 4.0 because I haven't used it in a