Stay organized with collections
Save and categorize content based on your preferences.
ThreadPolicy
class ThreadPolicy
StrictMode
policy applied to a certain thread.
The policy is enabled by setThreadPolicy
. The current policy can be retrieved with getThreadPolicy
.
Note that multiple penalties may be provided and they're run in order from least to most severe (logging before process death, for example). There's currently no mechanism to choose different penalties for different detected actions.
Summary
Public methods
toString
fun toString(): String
Return |
String |
a string representation of the object. |
Properties
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,["# StrictMode.ThreadPolicy\n\nAdded in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nThreadPolicy\n============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/os/StrictMode.ThreadPolicy \"View this page in Java\") \n\n```\nclass ThreadPolicy\n```\n\n|---|-----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.os.StrictMode.ThreadPolicy](#) |\n\n[StrictMode](/reference/kotlin/android/os/StrictMode) policy applied to a certain thread.\n\nThe policy is enabled by [setThreadPolicy](/reference/kotlin/android/os/StrictMode#setThreadPolicy(android.os.StrictMode.ThreadPolicy)). The current policy can be retrieved with [getThreadPolicy](/reference/kotlin/android/os/StrictMode#getThreadPolicy()).\n\nNote that multiple penalties may be provided and they're run in order from least to most severe (logging before process death, for example). There's currently no mechanism to choose different penalties for different detected actions.\n\nSummary\n-------\n\n| Nested classes ||\n|---|--------------------------------------------------------------------------------------------------------------|\n| | [Builder](/reference/kotlin/android/os/StrictMode.ThreadPolicy.Builder) Creates [ThreadPolicy](#) instances. |\n\n| Public methods ||\n|----------------------------------------------------------------------------------|------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` \u003cbr /\u003e |\n\n| Properties ||\n|--------------------------------------|---------------------------------------------------------------------------------------------|\n| static [StrictMode.ThreadPolicy](#)! | [LAX](#LAX:android.os.StrictMode.ThreadPolicy) The lax policy which doesn't catch anything. |\n\nPublic methods\n--------------\n\n### toString\n\nAdded in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |\n\nProperties\n----------\n\n### LAX\n\nAdded in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val LAX: StrictMode.ThreadPolicy!\n```\n\nThe lax policy which doesn't catch anything."]]