Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- findContact("123");
- findContact("1234");
- findContact("12345");
- findContact("123456");
- findContact("1234567");
- findContact("12345678");
- ...
- private void findContact(String number){
- Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
- ContentResolver cr = getContentResolver();
- Cursor phoneCursor = cr.query(uri, null, null, null, null);
- while(phoneCursor.moveToNext()){
- Log.e(TAG, number + "t" +phoneCursor.getString(phoneCursor.getColumnIndex(PhoneLookup._ID)));
- }
- phoneCursor.close();
- }
Add Comment
Please, Sign In to add comment