Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
    
    
  
  
    
    
    
    Groups
    class Groups : BaseColumns, ContactsContract.GroupsColumns, ContactsContract.SyncColumns
    
    Constants for the groups table. Only per-account groups are supported. 
      
Columns
 
       
        
           
            | Groups | 
 
 
           
            | long | 
 
            _ID | 
 
            read-only | 
 
            Row ID. Sync adapter should try to preserve row IDs during updates. In other words, it would be a really bad idea to delete and reinsert a group. A sync adapter should always do an update instead. | 
 
 # 
           
            | String | 
 
            DATA_SET | 
 
            read/write-once | 
 
             
                The data set within the account that this group belongs to. This allows multiple sync adapters for the same account type to distinguish between each others' group data. The combination of ACCOUNT_TYPE, ACCOUNT_NAME, and DATA_SET identifies a set of data that is associated with a single sync adapter.  
 
               This is empty by default, and is completely optional. It only needs to be populated if multiple sync adapters are entering distinct data for the same account type and account name.  
 
               It should be set at the time the group is inserted and never changed afterwards.  
  | 
 
 
           
            | String | 
 
            TITLE | 
 
            read/write | 
 
            The display title of this group. | 
 
 
           
            | String | 
 
            NOTES | 
 
            read/write | 
 
            Notes about the group. | 
 
 
           
            | String | 
 
            SYSTEM_ID | 
 
            read/write | 
 
            The ID of this group if it is a System Group, i.e. a group that has a special meaning to the sync adapter, null otherwise. | 
 
 
           
            | int | 
 
            SUMMARY_COUNT | 
 
            read-only | 
 
            The total number of Contacts that have CommonDataKinds.GroupMembership in this group. Read-only value that is only present when querying Groups.CONTENT_SUMMARY_URI. | 
 
 
           
            | int | 
 
            SUMMARY_WITH_PHONES | 
 
            read-only | 
 
            The total number of Contacts that have both CommonDataKinds.GroupMembership in this group, and also have phone numbers. Read-only value that is only present when querying Groups.CONTENT_SUMMARY_URI. | 
 
 
           
            | int | 
 
            GROUP_VISIBLE | 
 
            read-only | 
 
            Flag indicating if the contacts belonging to this group should be visible in any user interface. Allowed values: 0 and 1. | 
 
 
           
            | int | 
 
            DELETED | 
 
            read/write | 
 
            The "deleted" flag: "0" by default, "1" if the row has been marked for deletion. When android.content.ContentResolver#delete is called on a group, it is marked for deletion. The sync adaptor deletes the group on the server and then calls ContactResolver.delete once more, this time setting the the ContactsContract.CALLER_IS_SYNCADAPTER query parameter to finalize the data removal. | 
 
 
           
            | int | 
 
            SHOULD_SYNC | 
 
            read/write | 
 
            Whether this group should be synced if the SYNC_EVERYTHING settings is false for this group's account. | 
 
 
      
    
    Summary
    
      
        
          | Constants | 
        
        
          | static String | 
          
            
             The MIME type of a single group. 
           | 
        
        
          | static String | 
          
            
             The MIME type of a directory of groups. 
           | 
        
      
    
    
      
        
          | Inherited constants | 
        
        
          
            From class SyncColumns
              
                
                  
                    String | 
                    ACCOUNT_NAME
                      
                         The name of the account instance to which this row belongs, which when paired with ACCOUNT_TYPE identifies a specific account.  
                        Type: TEXT 
                      
                     | 
                   
                  
                    String | 
                    ACCOUNT_TYPE
                      
                         The type of account to which this row belongs, which when paired with ACCOUNT_NAME identifies a specific account.  
                        Type: TEXT 
                      
                     | 
                   
                  
                    String | 
                    DIRTY
                      
                         Flag indicating that VERSION has changed, and this row needs to be synchronized by its owning account.  
                        Type: INTEGER (boolean) 
                      
                     | 
                   
                  
                    String | 
                    SOURCE_ID
                      
                         String that uniquely identifies this row to its source account.  
                        Type: TEXT 
                      
                     | 
                   
                  
                    String | 
                    VERSION
                      
                         Version number that is updated whenever this row or its related data changes.  
                        Type: INTEGER 
                      
                     | 
                   
                
               
             
           | 
        
        
          
            From class GroupsColumns
              
                
                  
                    String | 
                    AUTO_ADD
                      
                         Any newly created contacts will automatically be added to groups that have this flag set to true.  
                         Type: INTEGER (boolean) 
                      
                     | 
                   
                  
                    String | 
                    DATA_SET
                      
                         The data set within the account that this group belongs to. This allows multiple sync adapters for the same account type to distinguish between each others' group data. This is empty by default, and is completely optional. It only needs to be populated if multiple sync adapters are entering distinct group data for the same account type and account name.  
                        Type: TEXT 
                      
                     | 
                   
                  
                    String | 
                    DELETED
                      
                         The "deleted" flag: "0" by default, "1" if the row has been marked for deletion. When android.content.ContentResolver#delete is called on a group, it is marked for deletion. The sync adaptor deletes the group on the server and then calls ContactResolver.delete once more, this time setting the the ContactsContract.CALLER_IS_SYNCADAPTER query parameter to finalize the data removal.  
                        Type: INTEGER 
                      
                     | 
                   
                  
                    String | 
                    FAVORITES
                      
                         When a contacts is marked as a favorites it will be automatically added to the groups that have this flag set, and when it is removed from favorites it will be removed from these groups.  
                         Type: INTEGER (boolean) 
                      
                     | 
                   
                  
                    String | 
                    GROUP_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 | 
                    GROUP_VISIBLE
                      
                         Flag indicating if the contacts belonging to this group should be visible in any user interface.  
                         Type: INTEGER (boolean) 
                      
                     | 
                   
                  
                    String | 
                    NOTES
                      
                         Notes about the group.  
                         Type: TEXT 
                      
                     | 
                   
                  
                    String | 
                    RES_PACKAGE
                      
                         The package name to use when creating Resources objects for this group. This value is only designed for use when building user interfaces, and should not be used to infer the owner. 
                      
                     | 
                   
                  
                    String | 
                    SHOULD_SYNC
                      
                         Whether this group should be synced if the SYNC_EVERYTHING settings is false for this group's account.  
                         Type: INTEGER (boolean) 
                      
                     | 
                   
                  
                    String | 
                    SUMMARY_COUNT
                      
                         The total number of Contacts that have CommonDataKinds.GroupMembership in this group. Read-only value that is only present when querying Groups.CONTENT_SUMMARY_URI.  
                         Type: INTEGER 
                      
                     | 
                   
                  
                    String | 
                    SUMMARY_WITH_PHONES
                      
                         The total number of Contacts that have both CommonDataKinds.GroupMembership in this group, and also have phone numbers. Read-only value that is only present when querying Groups.CONTENT_SUMMARY_URI.  
                         Type: INTEGER 
                      
                     | 
                   
                  
                    String | 
                    SYSTEM_ID
                      
                         The ID of this group if it is a System Group, i.e. a group that has a special meaning to the sync adapter, null otherwise.  
                        Type: TEXT 
                      
                     | 
                   
                  
                    String | 
                    TITLE
                      
                         The display title of this group.  
                         Type: TEXT 
                      
                     | 
                   
                  
                    String | 
                    TITLE_RES
                      
                         The display title of this group to load as a resource from RES_PACKAGE, which may be localized.  
                        Type: TEXT 
                      
                     | 
                   
                
               
             
           | 
        
        
          | 
            
           | 
        
        
          | 
            
           | 
        
      
    
    
    
      
        
          | Properties | 
        
        
          | static Uri! | 
          
            
             The content:// style URI for this table joined with details data from ContactsContract.Data. 
           | 
        
        
          | static Uri! | 
          
            
             The content:// style URI for this table 
           | 
        
      
    
    Constants
    
      CONTENT_ITEM_TYPE
      
      static val CONTENT_ITEM_TYPE: String
      The MIME type of a single group.
      Value: "vnd.android.cursor.item/group"
     
    
      CONTENT_TYPE
      
      static val CONTENT_TYPE: String
      The MIME type of a directory of groups.
      Value: "vnd.android.cursor.dir/group"
     
    Public methods
    
    Properties
    
      CONTENT_SUMMARY_URI
      
      static val CONTENT_SUMMARY_URI: Uri!
      The content:// style URI for this table joined with details data from ContactsContract.Data.
     
    
      CONTENT_URI
      
      static val CONTENT_URI: Uri!
      The content:// style URI for this table
     
  
  
  
    
  
 
  
    
      
      
    
    
      
    
    
  
       
    
    
      
    
  
  
  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."],[],[]]