Guest User

Untitled

a guest
Jul 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. findContact("123");
  2. findContact("1234");
  3. findContact("12345");
  4. findContact("123456");
  5. findContact("1234567");
  6. findContact("12345678");
  7. ...
  8.  
  9. private void findContact(String number){
  10. Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
  11. ContentResolver cr = getContentResolver();
  12. Cursor phoneCursor = cr.query(uri, null, null, null, null);
  13. while(phoneCursor.moveToNext()){
  14. Log.e(TAG, number + "t" +phoneCursor.getString(phoneCursor.getColumnIndex(PhoneLookup._ID)));
  15. }
  16.  
  17. phoneCursor.close();
  18. }
Add Comment
Please, Sign In to add comment