/** * Return the index of the first RawContactDelta corresponding to a writable raw-contact, or -1. * */ public int indexOfFirstWritableRawContact(Context context) { // Find the first writable entity. int entityIndex = 0; for (RawContactDelta delta : this) { if (delta.getRawContactAccountType(context).areContactsWritable()) return entityIndex; entityIndex++; } return -1; }