Sdílet prostřednictvím


FillCallback.OnFailure Method

Definition

Overloads

OnFailure(ICharSequence)

Notifies the Android System that a fill request ( AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback)) could not be fulfilled by the service (for example, because the user data was not available yet), so the request could be retried later.

OnFailure(String)

Notifies the Android System that a fill request ( AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback)) could not be fulfilled by the service (for example, because the user data was not available yet), so the request could be retried later.

OnFailure(ICharSequence)

Notifies the Android System that a fill request ( AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback)) could not be fulfilled by the service (for example, because the user data was not available yet), so the request could be retried later.

[Android.Runtime.Register("onFailure", "(Ljava/lang/CharSequence;)V", "", ApiSince=26)]
public void OnFailure (Java.Lang.ICharSequence? message);
[<Android.Runtime.Register("onFailure", "(Ljava/lang/CharSequence;)V", "", ApiSince=26)>]
member this.OnFailure : Java.Lang.ICharSequence -> unit

Parameters

message
ICharSequence

error message. <b>Note: </b> this message should <b>not</b> contain PII (Personally Identifiable Information, such as username or email address).

Attributes

Remarks

Notifies the Android System that a fill request ( AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback)) could not be fulfilled by the service (for example, because the user data was not available yet), so the request could be retried later.

<b>Note: </b>this method should not be used when the service didn't have the heursitics to fulfill the request; in this case, the service should call #onSuccess(FillResponse) onSuccess(null) instead.

<b>Note: </b>prior to android.os.Build.VERSION_CODES#Q, this method was not working as intended and the service should always call #onSuccess(FillResponse) onSuccess(null) instead.

<b>Note: </b>for apps targeting android.os.Build.VERSION_CODES#Q or higher, this method just logs the message on logcat; for apps targetting older SDKs, it also displays the message to user using a android.widget.Toast. Generally speaking, you should not display an error to the user if the request failed, unless the request had the FillRequest#FLAG_MANUAL_REQUEST flag.

Java documentation for android.service.autofill.FillCallback.onFailure(java.lang.CharSequence).

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

OnFailure(String)

Notifies the Android System that a fill request ( AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback)) could not be fulfilled by the service (for example, because the user data was not available yet), so the request could be retried later.

public void OnFailure (string? message);
member this.OnFailure : string -> unit

Parameters

message
String

error message. <b>Note: </b> this message should <b>not</b> contain PII (Personally Identifiable Information, such as username or email address).

Remarks

Notifies the Android System that a fill request ( AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback)) could not be fulfilled by the service (for example, because the user data was not available yet), so the request could be retried later.

<b>Note: </b>this method should not be used when the service didn't have the heursitics to fulfill the request; in this case, the service should call #onSuccess(FillResponse) onSuccess(null) instead.

<b>Note: </b>prior to android.os.Build.VERSION_CODES#Q, this method was not working as intended and the service should always call #onSuccess(FillResponse) onSuccess(null) instead.

<b>Note: </b>for apps targeting android.os.Build.VERSION_CODES#Q or higher, this method just logs the message on logcat; for apps targetting older SDKs, it also displays the message to user using a android.widget.Toast. Generally speaking, you should not display an error to the user if the request failed, unless the request had the FillRequest#FLAG_MANUAL_REQUEST flag.

Java documentation for android.service.autofill.FillCallback.onFailure(java.lang.CharSequence).

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