Stay organized with collections
Save and categorize content based on your preferences.
android.os.strictmode
Classes
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."],[],[],null,["# android.os.strictmode\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nandroid.os.strictmode\n=====================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/os/strictmode/package-summary \"View this page in Kotlin\") \\|Java\n\nClasses\n-------\n\n|-------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [CleartextNetworkViolation](/reference/android/os/strictmode/CleartextNetworkViolation) | |\n| [ContentUriWithoutPermissionViolation](/reference/android/os/strictmode/ContentUriWithoutPermissionViolation) | |\n| [CredentialProtectedWhileLockedViolation](/reference/android/os/strictmode/CredentialProtectedWhileLockedViolation) | Subclass of `Violation` that is used when a process accesses filesystem paths stored in credential protected storage areas while the user is locked. |\n| [CustomViolation](/reference/android/os/strictmode/CustomViolation) | |\n| [DiskReadViolation](/reference/android/os/strictmode/DiskReadViolation) | |\n| [DiskWriteViolation](/reference/android/os/strictmode/DiskWriteViolation) | |\n| [ExplicitGcViolation](/reference/android/os/strictmode/ExplicitGcViolation) | See #[StrictMode.ThreadPolicy.Builder.detectExplicitGc()](/reference/android/os/StrictMode.ThreadPolicy.Builder#detectExplicitGc()). |\n| [FileUriExposedViolation](/reference/android/os/strictmode/FileUriExposedViolation) | |\n| [ImplicitDirectBootViolation](/reference/android/os/strictmode/ImplicitDirectBootViolation) | Subclass of `Violation` that is used when a process implicitly relies on automatic Direct Boot filtering. |\n| [IncorrectContextUseViolation](/reference/android/os/strictmode/IncorrectContextUseViolation) | Incorrect usage of [Context](/reference/android/content/Context), such as obtaining a UI service from non-UI [Context](/reference/android/content/Context) instance. |\n| [InstanceCountViolation](/reference/android/os/strictmode/InstanceCountViolation) | |\n| [IntentReceiverLeakedViolation](/reference/android/os/strictmode/IntentReceiverLeakedViolation) | |\n| [LeakedClosableViolation](/reference/android/os/strictmode/LeakedClosableViolation) | |\n| [NetworkViolation](/reference/android/os/strictmode/NetworkViolation) | |\n| [NonSdkApiUsedViolation](/reference/android/os/strictmode/NonSdkApiUsedViolation) | Subclass of `Violation` that is used when a process accesses a non SDK API. |\n| [ResourceMismatchViolation](/reference/android/os/strictmode/ResourceMismatchViolation) | |\n| [ServiceConnectionLeakedViolation](/reference/android/os/strictmode/ServiceConnectionLeakedViolation) | |\n| [SqliteObjectLeakedViolation](/reference/android/os/strictmode/SqliteObjectLeakedViolation) | |\n| [UnbufferedIoViolation](/reference/android/os/strictmode/UnbufferedIoViolation) | See #[Builder.detectUnbufferedIo()](/reference/android/os/StrictMode.ThreadPolicy.Builder#detectUnbufferedIo()) |\n| [UnsafeIntentLaunchViolation](/reference/android/os/strictmode/UnsafeIntentLaunchViolation) | Violation raised when your app launches an [Intent](/reference/android/content/Intent) which originated from outside your app. |\n| [UntaggedSocketViolation](/reference/android/os/strictmode/UntaggedSocketViolation) | |\n| [Violation](/reference/android/os/strictmode/Violation) | Root class for all StrictMode violations. |\n| [WebViewMethodCalledOnWrongThreadViolation](/reference/android/os/strictmode/WebViewMethodCalledOnWrongThreadViolation) | |\n\n-\n\n Classes\n -------\n\n - [CleartextNetworkViolation](/reference/android/os/strictmode/CleartextNetworkViolation)\n - [ContentUriWithoutPermissionViolation](/reference/android/os/strictmode/ContentUriWithoutPermissionViolation)\n - [CredentialProtectedWhileLockedViolation](/reference/android/os/strictmode/CredentialProtectedWhileLockedViolation)\n - [CustomViolation](/reference/android/os/strictmode/CustomViolation)\n - [DiskReadViolation](/reference/android/os/strictmode/DiskReadViolation)\n - [DiskWriteViolation](/reference/android/os/strictmode/DiskWriteViolation)\n - [ExplicitGcViolation](/reference/android/os/strictmode/ExplicitGcViolation)\n - [FileUriExposedViolation](/reference/android/os/strictmode/FileUriExposedViolation)\n - [ImplicitDirectBootViolation](/reference/android/os/strictmode/ImplicitDirectBootViolation)\n - [IncorrectContextUseViolation](/reference/android/os/strictmode/IncorrectContextUseViolation)\n - [InstanceCountViolation](/reference/android/os/strictmode/InstanceCountViolation)\n - [IntentReceiverLeakedViolation](/reference/android/os/strictmode/IntentReceiverLeakedViolation)\n - [LeakedClosableViolation](/reference/android/os/strictmode/LeakedClosableViolation)\n - [NetworkViolation](/reference/android/os/strictmode/NetworkViolation)\n - [NonSdkApiUsedViolation](/reference/android/os/strictmode/NonSdkApiUsedViolation)\n - [ResourceMismatchViolation](/reference/android/os/strictmode/ResourceMismatchViolation)\n - [ServiceConnectionLeakedViolation](/reference/android/os/strictmode/ServiceConnectionLeakedViolation)\n - [SqliteObjectLeakedViolation](/reference/android/os/strictmode/SqliteObjectLeakedViolation)\n - [UnbufferedIoViolation](/reference/android/os/strictmode/UnbufferedIoViolation)\n - [UnsafeIntentLaunchViolation](/reference/android/os/strictmode/UnsafeIntentLaunchViolation)\n - [UntaggedSocketViolation](/reference/android/os/strictmode/UntaggedSocketViolation)\n - [Violation](/reference/android/os/strictmode/Violation)\n - [WebViewMethodCalledOnWrongThreadViolation](/reference/android/os/strictmode/WebViewMethodCalledOnWrongThreadViolation)"]]