Added in API level 26

FillContext


class FillContext : Parcelable
kotlin.Any
   ↳ android.service.autofill.FillContext

This class represents a context for each fill request made via AutofillService.onFillRequest(FillRequest, CancellationSignal, 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
Public methods
Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

AutofillId

The AutofillId of the view that triggered autofill.

Int

The id of the fill request this context corresponds to.

AssistStructure

The screen content.

String

Returns a string representation of the object.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<FillContext!>

Public methods

describeContents

Added in API level 26
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getFocusedId

Added in API level 29
fun getFocusedId(): AutofillId

The AutofillId of the view that triggered autofill.

Return
AutofillId This value cannot be null.

getRequestId

Added in API level 26
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.

getStructure

Added in API level 26
fun getStructure(): AssistStructure

The screen content.

Return
AssistStructure This value cannot be null.

toString

Added in API level 26
fun toString(): String

Returns a string representation of the object.

Return
String a string representation of the object.

writeToParcel

Added in API level 26
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.
This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

Properties

CREATOR

Added in API level 26
static val CREATOR: Parcelable.Creator<FillContext!>