added in API level 26

SaveCallback

public final class SaveCallback
extends Object

java.lang.Object
   ↳ android.service.autofill.SaveCallback


Handles save requests from the AutofillService into the Activity being autofilled.

Summary

Public methods

void onFailure(CharSequence message)

Notifies the Android System that an onSaveRequest(SaveRequest, SaveCallback) could not be handled by the service.

void onSuccess(IntentSender intentSender)

Notifies the Android System that an onSaveRequest(SaveRequest, SaveCallback) was successfully handled by the service.

void onSuccess()

Notifies the Android System that an onSaveRequest(SaveRequest, SaveCallback) was successfully handled by the service.

Inherited methods

Public methods

onFailure

added in API level 26
void onFailure (CharSequence message)

Notifies the Android System that an onSaveRequest(SaveRequest, SaveCallback) could not be handled by the service.

This method should only be called when the service could not handle the request right away and could not recover or retry it. If the service could retry or recover, it could keep the SaveRequest and call onSuccess() instead.

Note: The Android System displays an UI with the supplied error message; if you prefer to show your own message, call onSuccess() or onSuccess(IntentSender) instead.

Parameters
message CharSequence: error message to be displayed to the user.

onSuccess

void onSuccess (IntentSender intentSender)

Notifies the Android System that an onSaveRequest(SaveRequest, SaveCallback) was successfully handled by the service.

This method is useful when the service requires extra work—for example, launching an activity asking the user to authenticate first —before it can process the request, as the intent will be launched from the context of the activity being autofilled and hence will be part of that activity's stack.

Parameters
intentSender IntentSender: intent that will be launched from the context of activity being autofilled.

This value must never be null.

onSuccess

added in API level 26
void onSuccess ()

Notifies the Android System that an onSaveRequest(SaveRequest, SaveCallback) was successfully handled by the service.