Udostępnij za pośrednictwem


CredentialManager.PrepareGetCredential Method

Definition

Prepare for a get-credential operation.

[Android.Runtime.Register("prepareGetCredential", "(Landroid/credentials/GetCredentialRequest;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)]
public void PrepareGetCredential (Android.Credentials.GetCredentialRequest request, Android.OS.CancellationSignal? cancellationSignal, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("prepareGetCredential", "(Landroid/credentials/GetCredentialRequest;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)>]
member this.PrepareGetCredential : Android.Credentials.GetCredentialRequest * Android.OS.CancellationSignal * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit

Parameters

request
GetCredentialRequest

the request specifying type(s) of credentials to get from the user

cancellationSignal
CancellationSignal

an optional signal that allows for cancelling this call

executor
IExecutor

the callback will take place on this Executor

callback
IOutcomeReceiver

the callback invoked when the request succeeds or fails

Attributes

Remarks

Prepare for a get-credential operation. Returns a PrepareGetCredentialResponse that can launch the credential retrieval UI flow to request a user credential for your app.

This API doesn't invoke any UI. It only performs the preparation work so that you can later launch the remaining get-credential operation (involves UIs) through the #getCredential(PrepareGetCredentialResponse.PendingGetCredentialHandle, Context, CancellationSignal, Executor, OutcomeReceiver) API which incurs less latency compared to the #getCredential(GetCredentialRequest, Context, CancellationSignal, Executor, OutcomeReceiver) API that executes the whole operation in one call.

Java documentation for android.credentials.CredentialManager.prepareGetCredential(android.credentials.GetCredentialRequest, android.os.CancellationSignal, java.util.concurrent.Executor, android.os.OutcomeReceiver<android.credentials.PrepareGetCredentialResponse, android.credentials.GetCredentialException>).

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