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 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
Public methods
Int

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

Unit
writeToParcel(dest: Parcel, flags: Int)

Properties
static Parcelable.Creator<FillContext!>

Public methods

describeContents

Added in API level 26
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

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
Return
String a string representation of the object.

writeToParcel

Added in API level 26
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit
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 android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

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