Stay organized with collections
Save and categorize content based on your preferences.
Option
class Option
Stack walker option to configure the stack frame information obtained by a StackWalker
.
Summary
Enum values |
Retains Class object in StackFrame s walked by this StackWalker .
|
Shows all hidden frames.
|
Shows all reflection frames.
|
Enum values
SHOW_HIDDEN_FRAMES
enum val SHOW_HIDDEN_FRAMES : StackWalker.Option
Shows all hidden frames.
A Java Virtual Machine implementation may hide implementation specific frames in addition to reflection frames. A StackWalker
with this SHOW_HIDDEN_FRAMES
option will show all hidden frames (including reflection frames).
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,["# StackWalker.Option\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOption\n======\n\n```\nclass Option\n```\n\n|---|---|-----------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[java.lang.StackWalker.Option](#)\\\u003e ||\n| | ↳ | [java.lang.StackWalker.Option](#) |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [StackWalker.Option.RETAIN_CLASS_REFERENCE](#ENUM_VALUE:RETAIN_CLASS_REFERENCE), [StackWalker.Option.SHOW_HIDDEN_FRAMES](#ENUM_VALUE:SHOW_HIDDEN_FRAMES), [StackWalker.Option.SHOW_REFLECT_FRAMES](#ENUM_VALUE:SHOW_REFLECT_FRAMES) |---------------------------------------------------------------------------------|-----------------------------------------------------------------------| | [StackWalker.Option.RETAIN_CLASS_REFERENCE](#ENUM_VALUE:RETAIN_CLASS_REFERENCE) | Retains `Class` object in `StackFrame`s walked by this `StackWalker`. | | [StackWalker.Option.SHOW_HIDDEN_FRAMES](#ENUM_VALUE:SHOW_HIDDEN_FRAMES) | Shows all hidden frames. | | [StackWalker.Option.SHOW_REFLECT_FRAMES](#ENUM_VALUE:SHOW_REFLECT_FRAMES) | Shows all reflection frames. | |\n\nStack walker option to configure the [stack frame](/reference/kotlin/java/lang/StackWalker.StackFrame) information obtained by a `StackWalker`.\n\nSummary\n-------\n\n| Enum values ||\n|------------------------------------------------------------------------------------------------------------------------------------|---|\n| [RETAIN_CLASS_REFERENCE](#ENUM_VALUE:RETAIN_CLASS_REFERENCE) Retains `Class` object in `StackFrame`s walked by this `StackWalker`. |\n| [SHOW_HIDDEN_FRAMES](#ENUM_VALUE:SHOW_HIDDEN_FRAMES) Shows all hidden frames. |\n| [SHOW_REFLECT_FRAMES](#ENUM_VALUE:SHOW_REFLECT_FRAMES) Shows all reflection frames. |\n\nEnum values\n-----------\n\n### RETAIN_CLASS_REFERENCE\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val RETAIN_CLASS_REFERENCE : StackWalker.Option\n```\n\nRetains `Class` object in `StackFrame`s walked by this `StackWalker`.\n\nA `StackWalker` configured with this option will support [StackWalker.getCallerClass()](/reference/kotlin/java/lang/StackWalker#getCallerClass()) and [StackFrame.getDeclaringClass()](/reference/kotlin/java/lang/StackWalker.StackFrame#getDeclaringClass()). \n\n### SHOW_HIDDEN_FRAMES\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val SHOW_HIDDEN_FRAMES : StackWalker.Option\n```\n\nShows all hidden frames.\n\nA Java Virtual Machine implementation may hide implementation specific frames in addition to [reflection frames](#). A `StackWalker` with this `SHOW_HIDDEN_FRAMES` option will show all hidden frames (including reflection frames). \n\n### SHOW_REFLECT_FRAMES\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val SHOW_REFLECT_FRAMES : StackWalker.Option\n```\n\nShows all reflection frames.\n\nBy default, reflection frames are hidden. A `StackWalker` configured with this `SHOW_REFLECT_FRAMES` option will show all reflection frames that include [java.lang.reflect.Method#invoke](/reference/kotlin/java/lang/reflect/Method#invoke(kotlin.Any,%20kotlin.Any)) and [java.lang.reflect.Constructor#newInstance(Object...)](/reference/kotlin/java/lang/reflect/Constructor#newInstance(kotlin.Any)) and their reflection implementation classes.\n\nThe [SHOW_HIDDEN_FRAMES](#) option can also be used to show all reflection frames and it will also show other hidden frames that are implementation-specific."]]