Udostępnij za pośrednictwem


AutofillService.OnSaveRequest(SaveRequest, SaveCallback) Method

Definition

Called when the user requests the service to save the contents of a screen.

[Android.Runtime.Register("onSaveRequest", "(Landroid/service/autofill/SaveRequest;Landroid/service/autofill/SaveCallback;)V", "GetOnSaveRequest_Landroid_service_autofill_SaveRequest_Landroid_service_autofill_SaveCallback_Handler", ApiSince=26)]
public abstract void OnSaveRequest (Android.Service.Autofill.SaveRequest request, Android.Service.Autofill.SaveCallback callback);
[<Android.Runtime.Register("onSaveRequest", "(Landroid/service/autofill/SaveRequest;Landroid/service/autofill/SaveCallback;)V", "GetOnSaveRequest_Landroid_service_autofill_SaveRequest_Landroid_service_autofill_SaveCallback_Handler", ApiSince=26)>]
abstract member OnSaveRequest : Android.Service.Autofill.SaveRequest * Android.Service.Autofill.SaveCallback -> unit

Parameters

request
SaveRequest

the SaveRequest request to handle. See FillResponse for examples of multiple-sections requests.

callback
SaveCallback

object used to notify the result of the request.

Attributes

Remarks

Called when the user requests the service to save the contents of a screen.

If the service could not handle the request right away&mdash;for example, because it must launch an activity asking the user to authenticate first or because the network is down&mdash;the service could keep the SaveRequest request and reuse it later, but the service <b>must always</b> call SaveCallback#onSuccess() or SaveCallback#onSuccess(android.content.IntentSender) right away.

<b>Note:</b> To retrieve the actual value of fields input by the user, the service should call android.app.assist.AssistStructure.ViewNode#getAutofillValue(); if it calls android.app.assist.AssistStructure.ViewNode#getText() or other methods, there is no guarantee such method will return the most recent value of the field.

Java documentation for android.service.autofill.AutofillService.onSaveRequest(android.service.autofill.SaveRequest, android.service.autofill.SaveCallback).

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