Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
    
    
  
  
    
    
    
    Entity
    class Entity : BaseColumns, ContactsContract.DataColumns
    
     A sub-directory of a single raw contact that contains all of its ContactsContract.Data rows. To access this directory append RawContacts.Entity#CONTENT_DIRECTORY to the raw contact URI. See RawContactsEntity for a stand-alone table containing the same data. 
 
     Entity has two ID fields: _ID for the raw contact and DATA_ID for the data rows. Entity always contains at least one row, even if there are no actual data rows. In this case the DATA_ID field will be null. 
 
     Using Entity should be preferred to using two separate queries: RawContacts followed by Data. The reason is that Entity reads all data for a raw contact in one transaction, so there is no possibility of the data changing between the two queries.
    Summary
    
      
        
          | Constants | 
        
        
          | static String | 
          
            
             The directory twig for this sub-table 
           | 
        
        
          | static String | 
          
            
             The ID of the data row. 
           | 
        
      
    
    
      
        
          | Inherited constants | 
        
        
          
            From class DataColumns
              
                
                  
                    String | 
                    CARRIER_PRESENCE
                      
                         Carrier presence information.  
                         Type: INTEGER (A bitmask of CARRIER_PRESENCE_* fields)  
                      
                     | 
                   
                  
                    Int | 
                    CARRIER_PRESENCE_VT_CAPABLE
                      
                         Indicates that the entry is Video Telephony (VT) capable on the current carrier. An allowed bitmask of CARRIER_PRESENCE. 
                      
                     | 
                   
                  
                    String | 
                    DATA1
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA10
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA11
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA12
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA13
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA14
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA15
                      
                         Generic data column, the meaning is MIMETYPE specific. By convention, this field is used to store BLOBs (binary data). 
                      
                     | 
                   
                  
                    String | 
                    DATA2
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA3
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA4
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA5
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA6
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA7
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA8
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA9
                      
                         Generic data column, the meaning is MIMETYPE specific 
                      
                     | 
                   
                  
                    String | 
                    DATA_VERSION
                      
                         The version of this data record. This is a read-only value. The data column is guaranteed to not change without the version going up. This value is monotonically increasing.  
                        Type: INTEGER 
                      
                     | 
                   
                  
                    String | 
                    IS_PRIMARY
                      
                         Whether this is the primary entry of its kind for the raw contact it belongs to.  
                        Type: INTEGER (if set, non-0 means true) 
                      
                     | 
                   
                  
                    String | 
                    IS_READ_ONLY
                      
                         The "read-only" flag: "0" by default, "1" if the row cannot be modified or deleted except by a sync adapter. See ContactsContract.CALLER_IS_SYNCADAPTER.  
                        Type: INTEGER 
                      
                     | 
                   
                  
                    String | 
                    IS_SUPER_PRIMARY
                      
                         Whether this is the primary entry of its kind for the aggregate contact it belongs to. Any data record that is "super primary" must also be "primary".  
                        Type: INTEGER (if set, non-0 means true) 
                      
                     | 
                   
                  
                    String | 
                    MIMETYPE
                      
                         The MIME type of the item represented by this row. 
                      
                     | 
                   
                  
                    String | 
                    PREFERRED_PHONE_ACCOUNT_COMPONENT_NAME
                      
                         The flattened android.content.ComponentName of a that is the preferred PhoneAccountHandle to call the contact with.  
                         On a multi-SIM device this field can be used in a CommonDataKinds.Phone row to indicate the PhoneAccountHandle to call the number with, instead of using android.telecom.TelecomManager#getDefaultOutgoingPhoneAccount(String) or asking every time.  
                        android.telecom.TelecomManager#placeCall(Uri, android.os.Bundle) should be called with android.telecom.TelecomManager#EXTRA_PHONE_ACCOUNT_HANDLE set to the PhoneAccountHandle using the ComponentName from this field. 
                      
                     | 
                   
                  
                    String | 
                    PREFERRED_PHONE_ACCOUNT_ID
                      
                         The ID of a that is the preferred PhoneAccountHandle to call the contact with. Used by CommonDataKinds.Phone.  
                         On a multi-SIM device this field can be used in a CommonDataKinds.Phone row to indicate the PhoneAccountHandle to call the number with, instead of using android.telecom.TelecomManager#getDefaultOutgoingPhoneAccount(String) or asking every time.  
                        android.telecom.TelecomManager#placeCall(Uri, android.os.Bundle) should be called with android.telecom.TelecomManager#EXTRA_PHONE_ACCOUNT_HANDLE set to the PhoneAccountHandle using the id from this field. 
                      
                     | 
                   
                  
                    String | 
                    RAW_CONTACT_ID
                      
                         A reference to the RawContacts._ID that this data belongs to. 
                      
                     | 
                   
                  
                    String | 
                    RES_PACKAGE
                      
                         The package name to use when creating Resources objects for this data row. This value is only designed for use when building user interfaces, and should not be used to infer the owner. 
                      
                     | 
                   
                  
                    String | 
                    SYNC1
                      
                         Generic column for use by sync adapters. 
                      
                     | 
                   
                  
                    String | 
                    SYNC2
                      
                         Generic column for use by sync adapters. 
                      
                     | 
                   
                  
                    String | 
                    SYNC3
                      
                         Generic column for use by sync adapters. 
                      
                     | 
                   
                  
                    String | 
                    SYNC4
                      
                         Generic column for use by sync adapters. 
                      
                     | 
                   
                
               
             
           | 
        
        
          | 
            
           | 
        
      
    
    Constants
    
      CONTENT_DIRECTORY
      
      static val CONTENT_DIRECTORY: String
      The directory twig for this sub-table
      Value: "entity"
     
    
      DATA_ID
      
      static val DATA_ID: String
      The ID of the data row. The value will be null if this raw contact has no data rows. 
      Type: INTEGER
      Value: "data_id"
     
  
  
  
    
  
 
  
    
      
      
    
    
      
    
    
  
       
    
    
      
    
  
  
  Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
  Last updated 2025-02-10 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]