コード例 #1
0
  /** Build an {@link Entity} with the requested set of phone numbers. */
  protected EntityDelta getEntity(Long existingId, ContentValues... entries) {
    final ContentValues contact = new ContentValues();
    if (existingId != null) {
      contact.put(RawContacts._ID, existingId);
    }
    contact.put(RawContacts.ACCOUNT_NAME, TEST_ACCOUNT_NAME);
    contact.put(RawContacts.ACCOUNT_TYPE, TEST_ACCOUNT_TYPE);

    final Entity before = new Entity(contact);
    for (ContentValues values : entries) {
      before.addSubValue(Data.CONTENT_URI, values);
    }
    return EntityDelta.fromBefore(before);
  }