List of utility methods to do Contact Search
boolean | isContactNameByNumberExist(Context context, String number) judge qrcodecontacts exist by name Uri uri = Uri .parse("content://com.android.contacts/data/phones/filter/" + number); ContentResolver resolver = context.getContentResolver(); Cursor cursor = resolver.query(uri, new String[] { "display_name" }, null, null, null); return cursor.moveToFirst(); |
String | processContactsResult(Activity activity, Intent intent) process Contacts Result String result = null; Uri contactData = intent.getData(); Cursor c = activity.managedQuery(contactData, null, null, null, null); if (c.moveToFirst()) result = c.getString(c.getColumnIndexOrThrow(People.NUMBER)); c.close(); return result; ... |