Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
    
    
  
  
    
    
    
    Violation
    abstract class Violation : Throwable
    
    
      
        
          
            Known Direct Subclasses
              CleartextNetworkViolation,  ContentUriWithoutPermissionViolation,  CredentialProtectedWhileLockedViolation,  CustomViolation,  DiskReadViolation,  DiskWriteViolation,  ExplicitGcViolation,  FileUriExposedViolation,  ImplicitDirectBootViolation,  IncorrectContextUseViolation,  InstanceCountViolation,  IntentReceiverLeakedViolation, and 10 others.  
              
             
           | 
        
      
    
    Root class for all StrictMode violations.
    Summary
    
    Public methods
    
      fillInStackTrace
      
      open fun fillInStackTrace(): Throwable
      
        
          
            | Return | 
          
          
            Throwable | 
            a reference to this Throwable instance. | 
          
        
      
     
    
      hashCode
      
      open fun hashCode(): Int
      
        
          
            | Return | 
          
          
            Int | 
            a hash code value for this object. | 
          
        
      
     
    
      initCause
      
      open fun initCause(cause: Throwable?): Throwable
      
        
          
            | Parameters | 
          
          
            cause | 
            Throwable?: the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.) | 
          
        
      
      
        
          
            | Return | 
          
          
            Throwable | 
            a reference to this Throwable instance. | 
          
        
      
      
     
    
      setStackTrace
      
      open fun setStackTrace(stackTrace: Array<StackTraceElement!>): Unit
      
        
          
            | Parameters | 
          
          
            stackTrace | 
            Array<StackTraceElement!>: the stack trace elements to be associated with this Throwable. The specified array is copied by this call; changes in the specified array after the method invocation returns will have no affect on this Throwable's stack trace. | 
          
        
      
      
        
          
            | Exceptions | 
          
          
            java.lang.NullPointerException | 
            if stackTrace is null or if any of the elements of stackTrace are null | 
          
        
      
     
  
  
  
    
  
 
  
    
      
      
    
    
      
    
    
  
       
    
    
      
    
  
  
  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."],[],[]]