Throwable.InitCause(Throwable) Method

Definition

Initializes the cause of this throwable to the specified value.

[Android.Runtime.Register("initCause", "(Ljava/lang/Throwable;)Ljava/lang/Throwable;", "GetInitCause_Ljava_lang_Throwable_Handler")]
public virtual Java.Lang.Throwable InitCause (Java.Lang.Throwable? cause);
[<Android.Runtime.Register("initCause", "(Ljava/lang/Throwable;)Ljava/lang/Throwable;", "GetInitCause_Ljava_lang_Throwable_Handler")>]
abstract member InitCause : Java.Lang.Throwable -> Java.Lang.Throwable
override this.InitCause : Java.Lang.Throwable -> Java.Lang.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.)

Returns

Throwable

a reference to this Throwable instance.

Attributes

Exceptions

if Throwable is this object.

if the cause has already been initialized.

Remarks

Java documentation for java.lang.Throwable.initCause(java.lang.Throwable).

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