I'm trying to reduce the number of queries I do to the Android's database. Basically I want to get any email or IM address that contains a user defined search term. Right now I'm doing two separate queries:
Email:
Cursor emails = cr.query( ContactsContract.CommonDataKinds.Email.CONTENT_URI, null, ContactsContract.CommonDataKinds.Email.DATA + " LIKE ?", new String[] {searchTerm}, null);
IM:
Cursor cursor = cr.query( ContactsContract.Data.CONTENT_URI, null, ContactsContract.CommonDataKinds.Im.DATA + " LIKE ?", new String[] {searchTerm}, null);
Does anyone know of an easy way to combine both queries? The crux of the problem seems to be that the two content URI's are different.
Simon