Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
  
  
    
    
    
    ForceLoadContentObserver
    class ForceLoadContentObserver<D : Any!> : ContentObserver
    
    
    
    An implementation of a ContentObserver that takes care of connecting it to the Loader to have the loader re-load its data when the observer is told it has changed. You do not normally need to use this yourself; it is used for you by CursorLoader to take care of executing an update when the cursor's backing data changes.
    Summary
    
    
    
      
        
          | Inherited functions | 
        
          | From class ContentObserver
                
                  
                    | Unit | dispatchChange(selfChange: Boolean)
                         Dispatches a change notification to the observer.   If a Handlerwas supplied to theContentObserverconstructor, then a call to the #onChange method is posted to the handler's message queue. Otherwise, the #onChange method is invoked immediately on this thread. |  
                    | Unit | dispatchChange(selfChange: Boolean, uri: Uri?)
                         Dispatches a change notification to the observer. Includes the changed content Uri when available.   If a Handlerwas supplied to theContentObserverconstructor, then a call to the #onChange method is posted to the handler's message queue. Otherwise, the #onChange method is invoked immediately on this thread. |  
                    | Unit | dispatchChange(selfChange: Boolean, uri: Uri?, flags: Int)
                         Dispatches a change notification to the observer. Includes the changed content Uri when available.   If a Handlerwas supplied to theContentObserverconstructor, then a call to the #onChange method is posted to the handler's message queue. Otherwise, the #onChange method is invoked immediately on this thread. |  
                    | Unit | dispatchChange(selfChange: Boolean, uris: MutableCollection<Uri!>, flags: Int)
                         Dispatches a change notification to the observer. Includes the changed content Uris when available.   If a Handlerwas supplied to theContentObserverconstructor, then a call to the #onChange method is posted to the handler's message queue. Otherwise, the #onChange method is invoked immediately on this thread. |  
                    | Unit | onChange(selfChange: Boolean, uri: Uri?)
                         This method is called when a content change occurs. Includes the changed content Uri when available.   Subclasses should override this method to handle content changes. To ensure correct operation on older versions of the framework that did not provide richer arguments, applications should implement all overloads.   Example implementation:  <code>
  // Implement the onChange(boolean) method to delegate the change notification to
  // the onChange(boolean, Uri) method to ensure correct operation on older versions
  // of the framework that did not have the onChange(boolean, Uri) method.
  @Override
  public void onChange(boolean selfChange) {
      onChange(selfChange, null);
  }
 
  // Implement the onChange(boolean, Uri) method to take advantage of the new Uri argument.
  @Override
  public void onChange(boolean selfChange, Uri uri) {
      // Handle change.
  }
  </code> |  
                    | Unit | onChange(selfChange: Boolean, uri: Uri?, flags: Int)
                         This method is called when a content change occurs. Includes the changed content Uri when available.   Subclasses should override this method to handle content changes. To ensure correct operation on older versions of the framework that did not provide richer arguments, applications should implement all overloads. |  
                    | Unit | onChange(selfChange: Boolean, uris: MutableCollection<Uri!>, flags: Int)
                         This method is called when a content change occurs. Includes the changed content Uris when available.   Subclasses should override this method to handle content changes. To ensure correct operation on older versions of the framework that did not provide richer arguments, applications should implement all overloads. |  | 
      
    
    Public constructors
    
      ForceLoadContentObserver
      
      ForceLoadContentObserver()
     
    Public methods
    
      deliverSelfNotifications
      
      fun deliverSelfNotifications(): Boolean
      Deprecated: Deprecated in Java. 
      
        
          
            | Return | 
          
            | Boolean | True if self-change notifications should be delivered to the observer. | 
        
      
     
    
      onChange
      
      fun onChange(selfChange: Boolean): Unit
      Deprecated: Deprecated in Java. 
      
        
          
            | Parameters | 
          
            | selfChange | Boolean: True if this is a self-change notification. | 
        
      
     
  
  
  
    
  
 
  
    
    
      
       
    
    
  
  
  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.
  
  
  
    
      [null,null,["Last updated 2025-02-10 UTC."],[],[]]