Binder.Transact(Int32, Parcel, Parcel, TransactionFlags) Method

Definition

Default implementation rewinds the parcels and calls onTransact.

[Android.Runtime.Register("transact", "(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z", "")]
public bool Transact(int code, Android.OS.Parcel data, Android.OS.Parcel? reply, Android.OS.TransactionFlags flags);
[<Android.Runtime.Register("transact", "(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z", "")>]
abstract member Transact : int * Android.OS.Parcel * Android.OS.Parcel * Android.OS.TransactionFlags -> bool
override this.Transact : int * Android.OS.Parcel * Android.OS.Parcel * Android.OS.TransactionFlags -> bool

Parameters

code
Int32

The action to perform. This should be a number between FirstCallTransaction and LastCallTransaction.

data
Parcel

Marshalled data to send to the target. Must not be null. If you are not sending any data, you must create an empty Parcel that is given here.

reply
Parcel

Marshalled data to be received from the target. May be null if you are not interested in the return value.

flags
TransactionFlags

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

Returns

Returns the result from Binder.onTransact . A successful call generally returns true; false generally means the transaction code was not understood. For a oneway call to a different process false should never be returned. If a oneway call is made to code in the same process (usually to a C++ or Rust implementation), then there are no oneway semantics, and false can still be returned.

Implements

Attributes

Exceptions

Remarks

Default implementation rewinds the parcels and calls onTransact. On the remote side, transact calls into the binder to do the IPC.

Java documentation for android.os.Binder.transact(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