I got a cursor retrieving all the contacts on the app that have a street address. This cursor is then passed into an Adapter. So far so good. Except I also get a bunch of low value contacts (mostly from Skype) that only have a State/Country info. Is there an easy way to modify the URI to skip those?
public Cursor getDirectoryList (CharSequence constraint) {
String[] selectionArguments = { "%"+constraint.toString()+"%" };
String selection = ContactsContract.CommonDataKinds.StructuredPostal.DISPLAY_NAME + " like ?";
Uri uri = ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_URI;
String sortOrder = ContactsContract.CommonDataKinds.StructuredPostal.DISPLAY_NAME + " COLLATE LOCALIZED ASC";
Cursor cr = getContentResolver().query(uri, null, selection, selectionArguments, sortOrder);
return cr;
}