FillContext
class FillContext : Parcelable
This class represents a context for each fill request made via android.service.autofill.AutofillService#onFillRequest(android.service.autofill.FillRequest,android.os.CancellationSignal,android.service.autofill.FillCallback)
. It contains a snapshot of the UI state, the view ids that were returned by the autofill service
as both required to trigger a save and optional that can be saved, and the id of the corresponding FillRequest
.
This context allows you to inspect the values for the interesting views in the context they appeared. Also a reference to the corresponding fill request is useful to store meta-data in the client state bundle passed to FillResponse.Builder#setClientState(Bundle)
to avoid interpreting the UI state again while saving.
Summary
Inherited constants |
From class Parcelable
Int |
CONTENTS_FILE_DESCRIPTOR
Descriptor bit used with describeContents() : indicates that the Parcelable object's flattened representation includes a file descriptor.
|
Int |
PARCELABLE_WRITE_RETURN_VALUE
Flag for use with writeToParcel : the object being written is a return value, that is the result of a function such as "Parcelable someFunction() ", "void someFunction(out Parcelable) ", or "void someFunction(inout Parcelable) ". Some implementations may want to release resources at this point.
|
|
Public methods
describeContents
fun describeContents(): Int
getFocusedId
fun getFocusedId(): AutofillId
The AutofillId of the view that triggered autofill.
getRequestId
fun getRequestId(): Int
The id of the fill request
this context corresponds to. This is useful to associate your custom client state with every request to avoid reinterpreting the UI when saving user data.
toString
fun toString(): String
Return |
String |
a string representation of the object. |
Properties