Throwable.SetStackTrace(StackTraceElement[]) Method

Definition

Sets the stack trace elements that will be returned by #getStackTrace() and printed by #printStackTrace() and related methods.

[Android.Runtime.Register("setStackTrace", "([Ljava/lang/StackTraceElement;)V", "GetSetStackTrace_arrayLjava_lang_StackTraceElement_Handler")]
public virtual void SetStackTrace (Java.Lang.StackTraceElement[] stackTrace);
[<Android.Runtime.Register("setStackTrace", "([Ljava/lang/StackTraceElement;)V", "GetSetStackTrace_arrayLjava_lang_StackTraceElement_Handler")>]
override this.SetStackTrace : Java.Lang.StackTraceElement[] -> unit

Parameters

stackTrace
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.

Attributes

Exceptions

if any element in trace is null.

Remarks

Java documentation for java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also