Parcel.WriteException(Exception) Method

Definition

Special function for writing an exception result at the header of a parcel, to be used when returning an exception from a transaction.

[Android.Runtime.Register("writeException", "(Ljava/lang/Exception;)V", "")]
public void WriteException (Java.Lang.Exception e);
[<Android.Runtime.Register("writeException", "(Ljava/lang/Exception;)V", "")>]
member this.WriteException : Java.Lang.Exception -> unit

Parameters

e
Exception

The Exception to be written.

Attributes

Remarks

Special function for writing an exception result at the header of a parcel, to be used when returning an exception from a transaction. Note that this currently only supports a few exception types; any other exception will be re-thrown by this function as a RuntimeException (to be caught by the system's last-resort exception handling when dispatching a transaction).

The supported exception types are: <ul> <li>BadParcelableException<li>IllegalArgumentException<li>IllegalStateException<li>NullPointerException<li>SecurityException<li>UnsupportedOperationException<li>NetworkOnMainThreadException</ul>

Java documentation for android.os.Parcel.writeException(java.lang.Exception).

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