Compartir a través de


Binder.OnTransact(Int32, Parcel, Parcel, Int32) Method

Definition

Default implementation is a stub that returns false.

[Android.Runtime.Register("onTransact", "(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z", "GetOnTransact_ILandroid_os_Parcel_Landroid_os_Parcel_IHandler")]
protected virtual bool OnTransact (int code, Android.OS.Parcel data, Android.OS.Parcel? reply, int flags);
[<Android.Runtime.Register("onTransact", "(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z", "GetOnTransact_ILandroid_os_Parcel_Landroid_os_Parcel_IHandler")>]
abstract member OnTransact : int * Android.OS.Parcel * Android.OS.Parcel * int -> bool
override this.OnTransact : int * Android.OS.Parcel * Android.OS.Parcel * int -> bool

Parameters

code
Int32

The action to perform. This should be a number between #FIRST_CALL_TRANSACTION and #LAST_CALL_TRANSACTION.

data
Parcel

Marshalled data being received from the caller.

reply
Parcel

If the caller is expecting a result back, it should be marshalled in to here.

flags
Int32

Additional operation flags. Either 0 for a normal RPC, or #FLAG_ONEWAY for a one-way RPC.

Returns

Return true on a successful call; returning false is generally used to indicate that you did not understand the transaction code.

Attributes

Exceptions

Remarks

Default implementation is a stub that returns false. You will want to override this to do the appropriate unmarshalling of transactions.

If you want to call this, call transact().

Implementations that are returning a result should generally use Parcel#writeNoException() Parcel.writeNoException and Parcel#writeException(Exception) Parcel.writeException to propagate exceptions back to the caller.

Java documentation for android.os.Binder.onTransact(int, android.os.Parcel, android.os.Parcel, int).

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